Re: slow query execution - Mailing list pgsql-sql

From Trigve Siver
Subject Re: slow query execution
Date
Msg-id 247379.39180.qm@web52709.mail.re2.yahoo.com
Whole thread Raw
In response to slow query execution  (Trigve Siver <trigves@yahoo.com>)
List pgsql-sql
Thanks a lot

Trigve

----- Original Message ----
From: Rodrigo De León <rdeleonp@gmail.com>
To: pgsql-sql@postgresql.org; Trigve Siver <trigves@yahoo.com>
Sent: Wednesday, May 30, 2007 7:28:47 PM
Subject: Re: [SQL] slow query execution

On 5/30/07, Trigve Siver <trigves@yahoo.com> wrote:
> Can you point me to some sources
> or give me some examples, please?

CREATE OR REPLACE FUNCTION ROWNUM() RETURNS BIGINT AS
$$   BEGIN       RETURN NEXTVAL('ROWNUM_SEQ');   EXCEPTION WHEN OTHERS THEN       CREATE TEMP SEQUENCE ROWNUM_SEQ;
RETURN NEXTVAL('ROWNUM_SEQ');   END; 
$$
LANGUAGE 'PLPGSQL';

SELECT ROWNUM(), S.X
FROM GENERATE_SERIES(5,1,-1) S(X);

Remember to reset the sequence value if you use this more than once in
the same session.





____________________________________________________________________________________Take the Internet to Go: Yahoo!Go
putsthe Internet in your pocket: mail, news, photos & more.  
http://mobile.yahoo.com/go?refer=1GNXIC


pgsql-sql by date:

Previous
From: "Rodrigo De León"
Date:
Subject: Re: slow query execution
Next
From: Andrew Sullivan
Date:
Subject: Re: slow query execution