Re: SOLVED - RE: Poor performance using CTE

From: Vitalii Tymchyshyn <tivv00(at)gmail(dot)com>
To: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Greco <David_Greco(at)harte-hanks(dot)com>, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: SOLVED - RE: Poor performance using CTE
Date: 2012-11-22 17:37:21
Message-ID: CABWW-d027Zhb4bd7u34aJLD0+647RVfP10QytBN-q3dLjiwuLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

I'd also add ANALYZED/NOT ANALYZED. This should force it behave like
'create table, analyze, select' with statistics used in second query plan.

P.S. defaults can be configurable.
20 лист. 2012 02:22, "Gavin Flower" <GavinFlower(at)archidevsys(dot)co(dot)nz> напис.

> On 15/11/12 15:03, Peter Geoghegan wrote:
>
>> On 15 November 2012 01:46, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>
>>> It cuts both ways. I have used CTEs a LOT precisely because this
>>> behaviour
>>> lets me get better plans. Without that I'll be back to using the "offset
>>> 0"
>>> hack.
>>>
>> Is the "OFFSET 0" hack really so bad? We've been telling people to do
>> that for years, so it's already something that we've effectively
>> committed to.
>>
>> How about adding the keywords FENCED and NOT FENCED to the SQL
> definition of CTE's - with FENCED being the default?
>
>
> Cheers,
> Gavin
>
>
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)**
> org <pgsql-performance(at)postgresql(dot)org>)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-performance<http://www.postgresql.org/mailpref/pgsql-performance>
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Cédric Villemain 2012-11-23 10:05:52 Re: Hints (was Poor performance using CTE)
Previous Message Jon Nelson 2012-11-22 14:23:57 Re: Poor performance using CTE