Re: SOLVED - RE: Poor performance using CTE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Greco <David_Greco(at)harte-hanks(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: SOLVED - RE: Poor performance using CTE
Date: 2012-11-14 16:29:03
Message-ID: 20462.1352910543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

David Greco <David_Greco(at)harte-hanks(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2012-11-14 19:01:57 Re: postgres 8.4, COPY, and high concurrency
Previous Message David Greco 2012-11-14 16:18:42 SOLVED - RE: Poor performance using CTE