X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 69CF4D1DB13 for ; Tue, 13 Jan 2004 17:33:08 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 92593-05 for ; Tue, 13 Jan 2004 13:32:37 -0400 (AST) Received: from trade-india.com (unknown [61.16.154.82]) by svr1.postgresql.org (Postfix) with SMTP id 94E43D1DF7E for ; Tue, 13 Jan 2004 13:32:33 -0400 (AST) Received: (qmail 12359 invoked from network); 13 Jan 2004 17:31:37 -0000 Received: from system66.trade-india-local.com (HELO office1.trade-india.com) (192.168.0.66) by system66.trade-india-local.com with SMTP; 13 Jan 2004 17:31:37 -0000 Received: from 192.168.0.100 (SquirrelMail authenticated user mallah) by system67.trade-india-local.com with HTTP; Tue, 13 Jan 2004 23:01:37 +0530 (IST) Message-ID: <1157.192.168.0.100.1074015097.squirrel@system67.trade-india-local.com> In-Reply-To: <01C3D82B.388A7FE0.david@shadovitz.com> References: <01C3D82B.388A7FE0.david@shadovitz.com> Date: Tue, 13 Jan 2004 23:01:37 +0530 (IST) Subject: Re: COUNT & Pagination From: mallah@trade-india.com To: "david@shadovitz.com" Cc: "pgsql-performance@postgresql.org" User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/134 X-Sequence-Number: 5309 > I understand that COUNT queries are expensive. So I'm looking for advice > on > displaying paginated query results. > > I display my query results like this: > > Displaying 1 to 50 of 2905. > 1-50 | 51-100 | 101-150 | etc. > > I do this by executing two queries. One is of the form: > > SELECT