Re: COUNT & Pagination

From: David Shadovitz <david(at)shadovitz(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Cc: 'Richard Huxton' <dev(at)archonet(dot)com>
Subject: Re: COUNT & Pagination
Date: 2004-01-12 15:37:36
Message-ID: 01C3D8DF.271378C0.david@shadovitz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> 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

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Hannu Krosing 2004-01-12 16:12:09 Re: failures on machines using jfs
Previous Message Andrew Rawnsley 2004-01-12 15:02:09 Re: annoying query/planner choice