From: Trigve Siver <trigves@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: slow query execution
Date: Wed, 30 May 2007 11:08:02 -0700 (PDT)
Message-ID: <210031.38017.qm@web52704.mail.re2.yahoo.com> (raw)
>----- 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 and I 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
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-sql@postgresql.org
Cc: trigves@yahoo.com
Subject: Re: slow query execution
In-Reply-To: <210031.38017.qm@web52704.mail.re2.yahoo.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