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 1BBD0D1D27E for ; Sun, 11 Jan 2004 18:11:38 +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 83282-04 for ; Sun, 11 Jan 2004 14:11:07 -0400 (AST) Received: from swan.mail.pas.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by svr1.postgresql.org (Postfix) with ESMTP id 0F5EFD1B495 for ; Sun, 11 Jan 2004 14:11:06 -0400 (AST) Received: from user-11204mn.dsl.mindspring.com ([66.32.18.215] helo=shadovitzcmptr) by swan.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 1Afk3F-0000U2-00 for pgsql-performance@postgresql.org; Sun, 11 Jan 2004 10:11:05 -0800 Received: by localhost with Microsoft MAPI; Sun, 11 Jan 2004 10:11:04 -0800 Message-ID: <01C3D82B.388A7FE0.david@shadovitz.com> From: David Shadovitz Reply-To: "david@shadovitz.com" To: "pgsql-performance@postgresql.org" Subject: COUNT & Pagination Date: Sun, 11 Jan 2004 10:10:52 -0800 X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/108 X-Sequence-Number: 5283 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