Re: WITH RECURSIVE updated to CVS TIP

From: Hans-Juergen Schoenig <postgres(at)cybertec(dot)at>
To: David Fetter <david(at)fetter(dot)org>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WITH RECURSIVE updated to CVS TIP
Date: 2008-07-05 08:43:57
Message-ID: E85BEA16-60E4-419C-BD3F-C2DB7578DC58@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

hello david,

i did some quick testing with this wonderful patch.
it seems there are some flaws in there still:

test=# explain select count(*)
test-# from ( WITH RECURSIVE t(n) AS ( SELECT 1 UNION ALL
SELECT DISTINCT n+1 FROM t )
test(# SELECT * FROM t WHERE n < 5000000000) as t
test-# WHERE n < 100;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!> \q

this one will kill the planner :(
removing the (totally stupid) distinct avoids the core dump.

i found one more issue;

-- broken: wrong result
test=# select count(*) from ( WITH RECURSIVE t(n) AS (
SELECT 1 UNION ALL SELECT n + 1 FROM t)
SELECT * FROM t WHERE n < 5000000000) as t WHERE n < (
select count(*) from ( WITH RECURSIVE t(n) AS (
SELECT 1 UNION ALL SELECT n + 1 FROM t )
SELECT * FROM t WHERE n < 5000000000) as t WHERE n < 100) ;
count
-------
1
(1 row)

if i am not totally wrong, this should give us a different result.

i am looking forward to see this patch in core :).
it is simply wonderful ...

many thanks,

hans

On Jul 3, 2008, at 1:11 AM, David Fetter wrote:

> Folks,
>
> Please find patch enclosed, including some documentation.
>
> Can we see about getting this in this commitfest?
>
> Cheers,
> David.
> --
> David Fetter <david(at)fetter(dot)org> http://fetter.org/
> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
> Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/
> donate<recursive_query-7.patch.bz2>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Cybertec Schönig & Schönig GmbH
PostgreSQL Solutions and Support
Gröhrmühlgasse 26, 2700 Wiener Neustadt
Tel: +43/1/205 10 35 / 340
www.postgresql-support.de, www.postgresql-support.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-07-05 09:34:18 Re: pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut
Previous Message David E. Wheeler 2008-07-05 06:06:36 Re: PATCH: CITEXT 2.0

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2008-07-05 09:41:18 Re: Explain XML patch v2
Previous Message Heikki Linnakangas 2008-07-04 19:32:06 Re: Relation forks & FSM rewrite patches