Re: Joining on CTE is unusually slow?

From: Jon Rosebaugh <jon(at)inklesspen(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Joining on CTE is unusually slow?
Date: 2014-08-04 22:47:37
Message-ID: 1407192457.3180378.149115721.2A79E5A5@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G Johnston 2014-08-04 23:11:22 Re: Joining on CTE is unusually slow?
Previous Message Jon Rosebaugh 2014-08-04 22:40:05 Re: Joining on CTE is unusually slow?