From: David Shadovitz <david@shadovitz.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Cc: Richard Huxton <dev@archonet.com>
Subject: Re: COUNT & Pagination
Date: Mon, 12 Jan 2004 07:37:36 -0800
Message-ID: <01C3D8DF.271378C0.david@shadovitz.com> (raw)
> 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
<m>" clause, so $pg_numrows is m.
And retrieving all results (i.e. no LIMIT) is at least as expensive as
COUNT(*).
-David
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: david@shadovitz.com, dev@archonet.com
Subject: Re: COUNT & Pagination
In-Reply-To: <01C3D8DF.271378C0.david@shadovitz.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox