Re: Paged Query

From: Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Paged Query
Date: 2012-07-09 18:13:16
Message-ID: CABwTF4VdMvC=ka-W4x9KGv+Dq7B9q5b9ubk5QtMNtm9h+NTHXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Jul 9, 2012 at 1:46 PM, Andrew Dunstan <andrew(at)dunslane(dot)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<http://gurjeet-tech.blogspot.com/2011/02/pagination-of-results-in-postgres.html>

Best regards,
--
Gurjeet Singh
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Misa Simic 2012-07-09 22:24:31 Re: Paged Query
Previous Message Andrew Dunstan 2012-07-09 17:46:26 Re: Paged Query