From: Andres Freund <andres@2ndquadrant.com>
To: Claudio Freire <klaussfreire@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Craig Ringer <craig@2ndquadrant.com>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: David Greco <David_Greco@harte-hanks.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Poor performance using CTE
Date: Wed, 21 Nov 2012 17:34:50 +0100
Message-ID: <20121121163450.GB6268@awork2.anarazel.de> (raw)
In-Reply-To: <CAGTBQpZc78Cmg8nuJ0HvaTRX0Bj5bTNoJUDWMpn8yd8Z9PTtAg@mail.gmail.com>
References: <50AC1472.3050607@2ndQuadrant.com>
<18123.1353455585@sss.pgh.pa.us>
<50ACD166.1000507@vmware.com>
<50ACE970.7050701@dunslane.net>
<3396.1353509947@sss.pgh.pa.us>
<50ACF16C.2020902@dunslane.net>
<20121121153209.GA1271@awork2.anarazel.de>
<CAGTBQpa14GQ+L9KSKdS+kXVWYkoEVNUBbvaUpgRjskufEx-=-A@mail.gmail.com>
<20121121162416.GA6268@awork2.anarazel.de>
<CAGTBQpZc78Cmg8nuJ0HvaTRX0Bj5bTNoJUDWMpn8yd8Z9PTtAg@mail.gmail.com>
On 2012-11-21 13:32:45 -0300, Claudio Freire wrote:
> On Wed, Nov 21, 2012 at 1:24 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> > On 2012-11-21 13:16:25 -0300, Claudio Freire wrote:
> >> On Wed, Nov 21, 2012 at 12:32 PM, Andres Freund <andres@anarazel.de> wrote:
> >> > +1
> >> >
> >> > WITH foo AS (SELECT ...) (barrier=on|off)?
> >> >
> >> > 9.3 introduces the syntax, defaulting to on
> >> > 9.4 switches the default to off.
> >>
> >> Why syntax? What about a guc?
> >>
> >> collapse_cte_limit?
> >
> > Because there are very good reasons to want to current behaviour. A guc
> > is a global either/or so I don't see it helping much.
>
> set collapse_cte_limit=8;
> with blah as (blah) select blah;
>
> Not global at all.
Not very manageable though. And it doesn't help if you need both in a
query which isn't actually that unlikely.
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: andres@2ndquadrant.com, klaussfreire@gmail.com, andrew@dunslane.net, tgl@sss.pgh.pa.us, hlinnakangas@vmware.com, craig@2ndquadrant.com, mmoncure@gmail.com, David_Greco@harte-hanks.com
Subject: Re: Poor performance using CTE
In-Reply-To: <20121121163450.GB6268@awork2.anarazel.de>
References: <50AC1472.3050607@2ndQuadrant.com> <18123.1353455585@sss.pgh.pa.us> <50ACD166.1000507@vmware.com> <50ACE970.7050701@dunslane.net> <3396.1353509947@sss.pgh.pa.us> <50ACF16C.2020902@dunslane.net> <20121121153209.GA1271@awork2.anarazel.de> <CAGTBQpa14GQ+L9KSKdS+kXVWYkoEVNUBbvaUpgRjskufEx-=-A@mail.gmail.com> <20121121162416.GA6268@awork2.anarazel.de> <CAGTBQpZc78Cmg8nuJ0HvaTRX0Bj5bTNoJUDWMpn8yd8Z9PTtAg@mail.gmail.com> <20121121163450.GB6268@awork2.anarazel.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox