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 05C76D1D27C for ; Mon, 12 Jan 2004 15:39:16 +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 89483-01 for ; Mon, 12 Jan 2004 11:38:48 -0400 (AST) Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by svr1.postgresql.org (Postfix) with ESMTP id E9A0BD1B43F for ; Mon, 12 Jan 2004 11:38:43 -0400 (AST) Received: from hsa201.pool031.at101.earthlink.net ([216.249.100.201] helo=shadovitzcmptr) by pintail.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 1Ag49L-0003wd-00; Mon, 12 Jan 2004 07:38:43 -0800 Received: by localhost with Microsoft MAPI; Mon, 12 Jan 2004 07:39:04 -0800 Message-ID: <01C3D8DF.271378C0.david@shadovitz.com> From: David Shadovitz Reply-To: "david@shadovitz.com" To: "pgsql-performance@postgresql.org" Cc: 'Richard Huxton' Subject: Re: COUNT & Pagination Date: Mon, 12 Jan 2004 07:37:36 -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/123 X-Sequence-Number: 5298 > If you only need the count when you've got the results, most PG client > interfaces will tell you how many rows you've got. What language is your app > in? PHP. But I have only a subset of the results, retrieved via a query with a "LIMIT " clause, so $pg_numrows is m. And retrieving all results (i.e. no LIMIT) is at least as expensive as COUNT(*). -David