Skip site navigation (1) Skip section navigation (2)

Re: Common Table Expressions applied; some issues remain

From: "Jaime Casanova" <jcasanov(at)systemguards(dot)com(dot)ec>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Yoshiyuki Asaba" <y-asaba(at)sraoss(dot)co(dot)jp>, "Tatsuo Ishii" <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Common Table Expressions applied; some issues remain
Date: 2008-10-04 23:21:51
Message-ID: 3073cc9b0810041621p168fef24t11a7cda7c0a99135@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sat, Oct 4, 2008 at 5:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> that Oracle chooses to treat WITH-queries as if they were plain
> sub-selects if they're non-recursive and only referenced once.
> That is, Oracle would rewrite the above into
>
>        SELECT * FROM ( SELECT * FROM foo ) AS q WHERE key = 42;
>
> and then flatten the sub-select and optimize normally.  It would
> not be hard to make Postgres do the same, but then we would lose
> some guarantees about predictable execution of volatile functions.
>
[...]
>
> Any thoughts on what to do?  One possibility is to flatten only
> if the subquery doesn't contain any volatile functions.
>

maybe i'm missing something but AFAIR postgres will not try to
optimize (push down/pull up) if it see any volatile function.

-- 
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

In response to

pgsql-hackers by date

Next:From: Tatsuo IshiiDate: 2008-10-04 23:44:36
Subject: Re: Common Table Expressions applied; some issues remain
Previous:From: Tom LaneDate: 2008-10-04 22:39:49
Subject: Re: Obsolete functions istrue, isfalse, etc.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group