On Mon, Jul 9, 2012 at 1:46 PM, Andrew Dunstan <andrew@xxxxxxxxxxxx> wrote:
Yeah, the problem really is that most client code wants to know how many pages there are, even if it only wants one page right now.
On 07/09/2012 01:41 PM, Misa Simic wrote:
>From my experience users even very rare go to ending pages... easier to them would be to sort data by field to get those rows in very first pages...
FWIW, I wrote a little about getting the numbered results along with total result count in one query[1]. The suggestions in comments to use CTE provided even better performance.
[1] http://gurjeet-tech.blogspot.com/2011/02/pagination-of-results-in-postgres.html
Best regards,
--
Gurjeet Singh
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
EnterpriseDB Corporation
The Enterprise PostgreSQL Company