Re: [HACKERS] Cool hack with recursive queries

2008-11-23 Thread David Fetter
On Sun, Nov 23, 2008 at 11:49:31AM -0800, David Fetter wrote: > On Sun, Nov 23, 2008 at 12:34:21AM -0300, Alvaro Herrera wrote: > > Gregory Stark wrote: > > > > > WITH RECURSIVE Z(IX, IY, CX, CY, X, Y, I) AS ( > > > [elided] > > > > FWIW you can halve the running time by restricting I to 27 inste

Re: [HACKERS] Cool hack with recursive queries

2008-11-23 Thread David Fetter
On Sun, Nov 23, 2008 at 12:34:21AM -0300, Alvaro Herrera wrote: > Gregory Stark wrote: > > > WITH RECURSIVE Z(IX, IY, CX, CY, X, Y, I) AS ( > > [elided] > > FWIW you can halve the running time by restricting I to 27 instead of > 100 in the recursive term, and obtain the same result. I found it e

Re: [HACKERS] Cool hack with recursive queries

2008-11-22 Thread Alvaro Herrera
Gregory Stark wrote: > WITH RECURSIVE Z(IX, IY, CX, CY, X, Y, I) AS ( > SELECT IX, IY, X::float, Y::float, X::float, Y::float, 0 > FROM (select -2.2 + 0.031 * i, i from generate_series(0,101) > as i) as xgen(x,ix), > (select -1.5 + 0.031 * i, i

Re: [HACKERS] Cool hack with recursive queries

2008-11-22 Thread David Fetter
On Fri, Nov 21, 2008 at 04:33:16PM -0500, Bruce Momjian wrote: > Alvaro Herrera wrote: > > David Fetter escribi?: > > > On Fri, Nov 21, 2008 at 04:11:11PM -0500, Tom Lane wrote: > > > > > > This is a cool hack, agreed, but that doesn't make it a useful > > > > regression test. Whatever value it m

Re: [HACKERS] Cool hack with recursive queries

2008-11-22 Thread Stefan Kaltenbrunner
Tom Lane wrote: David Fetter <[EMAIL PROTECTED]> writes: On Fri, Nov 21, 2008 at 09:06:13PM +0100, Zdenek Kotala wrote: I takes 2.6 second on my laptop. I think it is not so bad. About 2.0 on my OS/X laptop. Could this be a problem on whatever architecture/OS/compiler combo you have? Not

Re: [HACKERS] Cool hack with recursive queries

2008-11-21 Thread Bruce Momjian
Alvaro Herrera wrote: > David Fetter escribi?: > > On Fri, Nov 21, 2008 at 04:11:11PM -0500, Tom Lane wrote: > > > > This is a cool hack, agreed, but that doesn't make it a useful > > > regression test. Whatever value it might have isn't going to repay > > > the community-wide expenditure of cycl

Re: [HACKERS] Cool hack with recursive queries

2008-11-21 Thread Alvaro Herrera
David Fetter escribió: > On Fri, Nov 21, 2008 at 04:11:11PM -0500, Tom Lane wrote: > > This is a cool hack, agreed, but that doesn't make it a useful > > regression test. Whatever value it might have isn't going to repay > > the community-wide expenditure of cycles. > > What's the slowest it run

Re: [HACKERS] Cool hack with recursive queries

2008-11-21 Thread David Fetter
On Fri, Nov 21, 2008 at 04:11:11PM -0500, Tom Lane wrote: > David Fetter <[EMAIL PROTECTED]> writes: > > On Fri, Nov 21, 2008 at 09:06:13PM +0100, Zdenek Kotala wrote: > >> I takes 2.6 second on my laptop. I think it is not so bad. > > > About 2.0 on my OS/X laptop. Could this be a problem on wha

Re: [HACKERS] Cool hack with recursive queries

2008-11-21 Thread Tom Lane
David Fetter <[EMAIL PROTECTED]> writes: > On Fri, Nov 21, 2008 at 09:06:13PM +0100, Zdenek Kotala wrote: >> I takes 2.6 second on my laptop. I think it is not so bad. > About 2.0 on my OS/X laptop. Could this be a problem on whatever > architecture/OS/compiler combo you have? Not everyone is us

Re: [HACKERS] Cool hack with recursive queries

2008-11-21 Thread David Fetter
On Fri, Nov 21, 2008 at 09:06:13PM +0100, Zdenek Kotala wrote: > Alvaro Herrera napsal(a): >> David Fetter escribió: >>> On Wed, Nov 19, 2008 at 10:21:06PM -, David Rowley wrote: Gregory Stark wrote: > So based on Graeme Job's T-SQL hack over at thedailywtf.com I > adapted the T-SQ

Re: [HACKERS] Cool hack with recursive queries

2008-11-21 Thread Merlin Moncure
On Fri, Nov 21, 2008 at 3:06 PM, Zdenek Kotala <[EMAIL PROTECTED]> wrote: > > I takes 2.6 second on my laptop. I think it is not so bad. > Time: 694.512 ms :-) merlin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgres

Re: [HACKERS] Cool hack with recursive queries

2008-11-21 Thread Zdenek Kotala
Alvaro Herrera napsal(a): David Fetter escribió: On Wed, Nov 19, 2008 at 10:21:06PM -, David Rowley wrote: Gregory Stark wrote: So based on Graeme Job's T-SQL hack over at thedailywtf.com I adapted the T-SQL code to Postgres and got this. Thought others might find it amusing. That's pret

Re: [HACKERS] Cool hack with recursive queries

2008-11-20 Thread Alvaro Herrera
David Fetter escribió: > On Wed, Nov 19, 2008 at 10:21:06PM -, David Rowley wrote: > > Gregory Stark wrote: > > > So based on Graeme Job's T-SQL hack over at thedailywtf.com I adapted the > > > T-SQL code to Postgres and got this. Thought others might find it amusing. > > > > > That's pretty a

Re: [HACKERS] Cool hack with recursive queries

2008-11-20 Thread David Fetter
On Wed, Nov 19, 2008 at 10:21:06PM -, David Rowley wrote: > Gregory Stark wrote: > > So based on Graeme Job's T-SQL hack over at thedailywtf.com I adapted the > > T-SQL code to Postgres and got this. Thought others might find it amusing. > > > That's pretty amazing. > > I think we should add

Re: [HACKERS] Cool hack with recursive queries

2008-11-20 Thread Harald Armin Massa
1st) it turns out PostgreSQL allows code that is more compact than MSQL: 19 lines instead of 46 lines 2nd) now there will be a really compelling reason for DBAs worldwide to upgrade to 8.4; after release everyone without Mandelbrot in SQL is just a lame noob 3rd) maybe THAT could be the final s

Re: [HACKERS] Cool hack with recursive queries

2008-11-19 Thread Tatsuo Ishii
> So based on Graeme Job's T-SQL hack over at thedailywtf.com I adapted the > T-SQL code to Postgres and got this. Thought others might find it amusing. > > WITH RECURSIVE Z(IX, IY, CX, CY, X, Y, I) AS ( > SELECT IX, IY, X::float, Y::float, X::float, Y::float, 0 > F

Re: [HACKERS] Cool hack with recursive queries

2008-11-19 Thread David Rowley
Gregory Stark wrote: > So based on Graeme Job's T-SQL hack over at thedailywtf.com I adapted the > T-SQL code to Postgres and got this. Thought others might find it amusing. > > WITH RECURSIVE Z(IX, IY, CX, CY, X, Y, I) AS ( > SELECT IX, IY, X::float, Y::float, X::float, Y::float,

Re: [HACKERS] Cool hack with recursive queries

2008-11-19 Thread Grzegorz Jaskiewicz
On 2008-11-19, at 21:53, Gregory Stark wrote: So based on Graeme Job's T-SQL hack over at thedailywtf.com I adapted the T-SQL code to Postgres and got this. Thought others might find it amusing. hohoho, nice. That's even better than mine "with recursive" PI generator :) -- Sent vi

[HACKERS] Cool hack with recursive queries

2008-11-19 Thread Gregory Stark
So based on Graeme Job's T-SQL hack over at thedailywtf.com I adapted the T-SQL code to Postgres and got this. Thought others might find it amusing. WITH RECURSIVE Z(IX, IY, CX, CY, X, Y, I) AS ( SELECT IX, IY, X::float, Y::float, X::float, Y::float, 0 FROM (select