pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Stehule <pavel.stehule@gmail.com>
To: Martijn van Oosterhout <kleptog@svana.org>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-hackers@postgresql.org, "Tom Lane" <tgl@sss.pgh.pa.us>
Subject: Re: WITH RECUSIVE patches 0723
Date: Tue, 29 Jul 2008 08:42:51 +0200
Message-ID: <162867790807282342p61cf7fcem75c99f8af4a075e1@mail.gmail.com> (raw)
In-Reply-To: <20080728222446.GC24856@svana.org>
References: <20080725001513.GF16438@fetter.org>
	<20080725.092652.105178884.t-ishii@sraoss.co.jp>
	<87r69gs967.fsf@news-spur.riddles.org.uk>
	<20080728.162925.23020498.t-ishii@sraoss.co.jp>
	<19882.1217256991@sss.pgh.pa.us>
	<87myk1rg4z.fsf@news-spur.riddles.org.uk>
	<20080728222446.GC24856@svana.org>

Hello

2008/7/29 Martijn van Oosterhout <kleptog@svana.org>:
> On Mon, Jul 28, 2008 at 07:57:16PM +0100, Andrew Gierth wrote:
>> Which will be a serious pessimization in many common cases if you do
>> it all the time. Googling for examples of non-recursive WITH queries
>> shows that it is very widely used for clarity or convenience, in
>> contexts where you _don't_ want materialization.
>
> Since the problem is using the result of a WITH clause more than once,
> would it be sufficient to simply detect that case and bail? You don't
> want materialisation is most cases, there's just a few where it is
> needed.
>

I thing so materialisation is more important than you thing. Without
materialisation I could use derived tables, but materialisation in
WITH statement is unique feature usefull for analytical queries. I am
sure, so materialisation should be one from possible strategies.

I like to see this feature in core, with/without materialisation is
usefull for recursive queries and I thing so materialisation should be
add in next months. I don't see it as mayor break. I prefere early
commit of this patch (with neccessary documentation), because there
will be some work that cannot be commited concurently - analytic
queries and my implementation of rollup and cube operator.

Regards
Pavel Stehule

> Have a nice day,
> --
> Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
>> Please line up in a tree and maintain the heap invariant while
>> boarding. Thank you for flying nlogn airlines.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIjkcuIB7bNG8LQkwRAto4AJwPkKlCWD/yBjAyEBL/LXMLK08LPwCfZ2dq
> qSHGPoPPGwGIQOP62eQimGE=
> =Yog+
> -----END PGP SIGNATURE-----
>
>



view thread (39+ messages)  latest in thread

Message-ID: <162867790807282342p61cf7fcem75c99f8af4a075e1@mail.gmail.com>
Permalink:  ../162867790807282342p61cf7fcem75c99f8af4a075e1@mail.gmail.com/
Also on:    postgresql.org/message-id/162867790807282342p61cf7fcem75c99f8af4a075e1@mail.gmail.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-patches@postgresql.org
  Cc: pavel.stehule@gmail.com, kleptog@svana.org, andrew@tao11.riddles.org.uk, tgl@sss.pgh.pa.us
  Subject: Re: WITH RECUSIVE patches 0723
  In-Reply-To: <162867790807282342p61cf7fcem75c99f8af4a075e1@mail.gmail.com>

* 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