Re: Paged Query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 9, 2012 at 1:46 PM, Andrew Dunstan <andrew@xxxxxxxxxxxx> 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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux