Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 40A879FBF12 for ; Wed, 30 May 2007 15:55:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 03149-02 for ; Wed, 30 May 2007 15:55:06 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web52707.mail.re2.yahoo.com (web52707.mail.re2.yahoo.com [206.190.48.230]) by postgresql.org (Postfix) with SMTP id 32A839FBA73 for ; Wed, 30 May 2007 15:55:08 -0300 (ADT) Received: (qmail 47558 invoked by uid 60001); 30 May 2007 18:55:07 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=nTJl9+JaXfps8S6zNE0ZWNmztM0JyC831WDCqy+fAZBYi03HNJ9BvTLAggwEu9Yzp6KSkqire8CHFLcFsaX1dCJzldJEiDFrbKFFs/S9gskCRoowcQmjB9yeEuHCMUnfMmYLLLFTd6ZDUz6qOyyKX07CKhfJo0dM2w10/rgCizY=; X-YMail-OSG: 5Ooyr_QVM1kzeqWUOqJJSBudj5EGwyHmFD7NLOFqVTVQBIq2YwPFU4ZSMyY0yWkNzL7q1eF_GBoUqEvv0PXgzC_qTY7sDxCO83YwYC7T8s.98o0xMvKr9kzsEH4NiA-- Received: from [195.168.227.227] by web52707.mail.re2.yahoo.com via HTTP; Wed, 30 May 2007 11:55:06 PDT X-Mailer: YahooMailRC/651.23.1 YahooMailWebService/0.7.41.14 Date: Wed, 30 May 2007 11:55:05 -0700 (PDT) From: Trigve Siver Subject: Re: slow query execution To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Message-ID: <979338.47402.qm@web52707.mail.re2.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.041 tagged_above=0 required=5 tests=AWL=-0.129, BAYES_40=-0.185, DNS_FROM_RFC_ABUSE=0.2, DNS_FROM_RFC_POST=1.708, DNS_FROM_RFC_WHOIS=1.447 X-Spam-Level: *** X-Archive-Number: 200705/200 X-Sequence-Number: 28480 >----- Original Message ---- >From: Andrew Sullivan >To: pgsql-sql@postgresql.org >Sent: Wednesday, May 30, 2007 8:30:32 PM >Subject: Re: [SQL] slow query execution > >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? I seee...when new data will be added to table, then row numbers wouldn''t be valid anymore. Hmmm...looked like I need to find other solution. thanks Trigve ____________________________________________________________________________________Get the free Yahoo! toolbar and rest assured with the added security of spyware protection. http://new.toolbar.yahoo.com/toolbar/features/norton/index.php