Re: slow query execution - Mailing list pgsql-sql

From Trigve Siver
Subject Re: slow query execution
Date
Msg-id 210031.38017.qm@web52704.mail.re2.yahoo.com
Whole thread Raw
In response to slow query execution  (Trigve Siver <trigves@yahoo.com>)
Responses Re: slow query execution  (Andrew Sullivan <ajs@crankycanuck.ca>)
List pgsql-sql
>----- Original Message ----
>From: Andrew Sullivan <ajs@crankycanuck.ca>
>To: pgsql-sql@postgresql.org
>Sent: Wednesday, May 30, 2007 7:39:18 PM
>Subject: Re: [SQL] slow query execution
>
>On Wed, May 30, 2007 at 10:03:16AM -0700, Trigve Siver wrote:
>> Hi, Thanks for reply, As you have mentioned I need to get row
>> numbers for my query, so when I make some other query with same
>> data I will know which row number has a particular ID. 
>
>Oh, wait.  If _that's_ your plan, then this will never work.  The
>data could change, and your row numbers would come out wrong. 
>What do you need "row numbers" for anyway?  The very idea is inimical
>to SQL, because the data is fundamentally unordered.  

I want to do it only for some queries. So when I need query like that "SELECT * from t1"
I need to add row_numbers there. So I will have "query with row_numbers" (where row_numbers 
are row numbers of my virtual list view). Then when I perform search I also get row_numbers for IDs of search result
andI can highlight items in my list view. I haven't found other solution that met my requirements.
 

I want also do it with cursors.

[...]

>I think there's some nifty way to get generate_series to do this too,
>but I don't know it offhand (generating row numbers sounds to me like
>a bad idea, so I don't do it).

I have tried with generate_series but without success.

thanks

Trigve




      
____________________________________________________________________________________Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz


pgsql-sql by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: slow query execution
Next
From: Andrew Sullivan
Date:
Subject: Re: slow query execution