Re: SOLVED - RE: Poor performance using CTE - Mailing list pgsql-performance

From Tom Lane
Subject Re: SOLVED - RE: Poor performance using CTE
Date
Msg-id 20462.1352910543@sss.pgh.pa.us
Whole thread Raw
In response to SOLVED - RE: Poor performance using CTE  (David Greco <David_Greco@harte-hanks.com>)
Responses Re: SOLVED - RE: Poor performance using CTE
List pgsql-performance
David Greco <David_Greco@harte-hanks.com> writes:
> Thanks, that did the trick. Though I'm still not clear as to why.

PG treats WITH as an optimization fence --- the WITH query will be
executed pretty much as-is.  It may be that Oracle flattens the query
somehow; though if you're using black-box functions in both cases,
it's not obvious where the optimizer could get any purchase that way.

            regards, tom lane


pgsql-performance by date:

Previous
From: David Greco
Date:
Subject: SOLVED - RE: Poor performance using CTE
Next
From: Jeff Janes
Date:
Subject: Re: postgres 8.4, COPY, and high concurrency