Re: slow query execution - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: slow query execution
Date
Msg-id 20070530183032.GP16260@phlogiston.dyndns.org
Whole thread Raw
In response to Re: slow query execution  (Trigve Siver <trigves@yahoo.com>)
List pgsql-sql
On Wed, May 30, 2007 at 11:08:02AM -0700, Trigve Siver wrote:

> 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.

You really need to ensure you keep that ORDER BY in there, then.  The
order that SQL returns in is not determined until the data has come
back.  Are you doing this all in one serialisable transaction,
though?  If not, what guarantee will you have that new data won't
mess up your row numbering from query to query?

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
The plural of anecdote is not data.    --Roger Brinner


pgsql-sql by date:

Previous
From: Trigve Siver
Date:
Subject: Re: slow query execution
Next
From: Trigve Siver
Date:
Subject: Re: slow query execution