Re: Paged Query - Mailing list pgsql-performance

From Gurjeet Singh
Subject Re: Paged Query
Date
Msg-id CABwTF4VdMvC=ka-W4x9KGv+Dq7B9q5b9ubk5QtMNtm9h+NTHXQ@mail.gmail.com
Whole thread Raw
In response to Re: Paged Query  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-performance
On Mon, Jul 9, 2012 at 1:46 PM, Andrew Dunstan <andrew@dunslane.net> wrote:

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...




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.

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

pgsql-performance by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Paged Query
Next
From: Misa Simic
Date:
Subject: Re: Paged Query