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

From Craig Ringer
Subject Re: Poor performance using CTE
Date
Msg-id 50AD750B.8010108@2ndQuadrant.com
Whole thread Raw
In response to Re: Poor performance using CTE  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-performance
On 11/22/2012 08:38 AM, Gavin Flower wrote:
> I suspect most people are blissfully unaware of CTE's being fenced, or
> at least not really sure what it means. So I suspect NOT FENCE would
> be the better default.
It's also probably more standard, and a better fit with what other DBs do.

Pg would still need to detect conditions like the use of functions with
side effects or (obviously) INSERT/UPDATE/DELETE wCTEs and not push
conditions down into them / pull conditions up from them, etc. That's
how I read the standard, though; must have the same effect as if the
queries were executed as written, so Pg is free to transform them so
long as it doesn't change the results.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



pgsql-performance by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Poor performance using CTE
Next
From: Jeff Janes
Date:
Subject: Re: Hints (was Poor performance using CTE)