Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 798A59FA291 for ; Wed, 30 May 2007 15:30:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 95528-08 for ; Wed, 30 May 2007 15:30:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id BC8D19FA0B7 for ; Wed, 30 May 2007 15:30:39 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1HtSwQ-0007po-8v for pgsql-sql@postgresql.org; Wed, 30 May 2007 14:30:38 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id BB2773FAF; Wed, 30 May 2007 14:30:32 -0400 (EDT) Date: Wed, 30 May 2007 14:30:32 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: slow query execution Message-ID: <20070530183032.GP16260@phlogiston.dyndns.org> References: <210031.38017.qm@web52704.mail.re2.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <210031.38017.qm@web52704.mail.re2.yahoo.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/199 X-Sequence-Number: 28479 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