Re: Joining on CTE is unusually slow? - Mailing list pgsql-general

From Jon Rosebaugh
Subject Re: Joining on CTE is unusually slow?
Date
Msg-id 1407192457.3180378.149115721.2A79E5A5@webmail.messagingengine.com
Whole thread Raw
In response to Re: Joining on CTE is unusually slow?  (Jon Rosebaugh <jon@inklesspen.com>)
Responses Re: Joining on CTE is unusually slow?  (David G Johnston <david.g.johnston@gmail.com>)
List pgsql-general
On Mon, Aug 4, 2014, at 06:40 PM, Jon Rosebaugh wrote:
> On Tue, Jul 29, 2014, at 05:38 PM, David G Johnston wrote:
> > You should at least provide some explain a/o explain analyse results.
> >
> > Not to sound pedantic here but you are not JOINing on the CTE, you are
> > pushing it into WHERE clause via a pair of sub-selects.
>
> Fair criticisms. Okay, here we go. Table schemas at the end of the
> email. My apologies for the length; I didn't want to try trimming out
> "irrelevant" things that would end up causing actual changes to the
> question I'm asking. I've run EXPLAIN ANALYZE for all the queries.

Looks like line wrapping might have done a number on the explain output.
I've put it all in the following pastebin just in case:

https://gist.github.com/inklesspen/7e2577cf6fa9f73bc9c2


pgsql-general by date:

Previous
From: Jon Rosebaugh
Date:
Subject: Re: Joining on CTE is unusually slow?
Next
From: David G Johnston
Date:
Subject: Re: Joining on CTE is unusually slow?