Re: Poor performance using CTE

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, David Greco <David_Greco(at)harte-hanks(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Poor performance using CTE
Date: 2012-11-20 23:44:51
Message-ID: CAGTBQpZ9zfVLn8wqxOi5sQJ2P+VtE5YksNGSmQD0aH_oDOOGkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Nov 20, 2012 at 8:38 PM, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:
> On 11/21/2012 12:06 AM, Claudio Freire wrote:
>> I meant for postgres to do automatically. Rewriting as a join wouldn't
>> work as an optimization fence the way we're used to, but pushing
>> constraints upwards can only help (especially if highly selective).
> Because people are now used to using CTEs as query hints, it'd probably
> cause performance regressions in working queries. Perhaps more
> importantly, Pg would have to prove that doing so didn't change queries
> that invoked functions with side-effects to avoid changing the results
> of currently valid queries.

Fair point. Will look into it a bit.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2012-11-20 23:53:05 Re: Poor performance using CTE
Previous Message Craig Ringer 2012-11-20 23:38:26 Re: Poor performance using CTE