X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 5F40311F8C79 for ; Fri, 21 Apr 2006 15:19:40 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.466 X-Spam-Level: X-Spam-Status: No, score=-2.466 required=5 tests=[AWL=0.133, BAYES_00=-2.599] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id HvFL3AEHYQ2c for ; Fri, 21 Apr 2006 15:19:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 7DE7711F6F0E for ; Fri, 21 Apr 2006 15:19:29 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id AE61556408; Fri, 21 Apr 2006 13:19:29 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Fri, 21 Apr 2006 13:19:27 -0500 Date: Fri, 21 Apr 2006 13:19:27 -0500 From: "Jim C. Nasby" To: Merlin Moncure Cc: soni de , pgsql-performance@postgresql.org Subject: Re: Takes too long to fetch the data from database Message-ID: <20060421181927.GK49405@pervasive.com> References: <9f2e40a90604100021n1cb694d0lb95f318f800f33ee@mail.gmail.com> <9f2e40a90604110004u787716c2s22bdf53fe349326@mail.gmail.com> <9f2e40a90604192237i5d3e8f0dl1c8b19887bc34e22@mail.gmail.com> <9f2e40a90604202142x5adbe6f0r7a993f8319619cc7@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060421:mmoncure@gmail.com::p5IkpU4L7WYBYDiK:0000000000000000000 0000000000000000000000000wfx X-Hashcash: 1:20:060421:soni.de@gmail.com::KyzLpFtxuVkmqV/F:00000000000000000000 0000000000000000000000009WL3 X-Hashcash: 1:20:060421:pgsql-performance@postgresql.org::2BntZhNLL44MBYv1:00000 0000000000000000000000003Obf X-Archive-Number: 200604/508 X-Sequence-Number: 18592 On Fri, Apr 21, 2006 at 09:44:25AM -0400, Merlin Moncure wrote: > 2nd 50: > select * from t where j >= j1 and (j > j1 or k > k1) order by j, k limit 50; > 3 fields: > select * from t where i >= i1 and (i > i1 or j >= j1) and (i > i1 or j > > k1 or k > k1) order by i,j,k limit 50; Note that in 8.2 you'll be able to do: WHERE (i, j, k) >= (i1, j1, k1) -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461