Skip site navigation (1) Skip section navigation (2)

Fwd: Speed with offset clause

From: Yves Vindevogel <yves(dot)vindevogel(at)implements(dot)be>
To: pgsql-performance(at)postgresql(dot)org
Subject: Fwd: Speed with offset clause
Date: 2005-06-24 20:19:26
Message-ID: 2efd5ae220a4d27b141196b0e7c752e1@implements.be (view raw or flat)
Thread:
Lists: pgsql-performance
>
> Hmm, I can't do this, i'm afraid.  Or it would be rather difficult
>
> My query is executed through a webpage (link to the page in a 
> navigation bar)
> I do not know how many records there are (data is changing, and 
> currently is 600k records)
>
> The only thing I could do, is doing this in a function where I first 
> get the page, and then decide whether to use the normal sort order or 
> the reversed order
> That would put my weak point right in the middle, which is not that 
> bad, but I would like to find an easier way, if that is possible
>
> Huge memory would help ?
>
> On 24 Jun 2005, at 20:54, hubert depesz lubaczewski wrote:
>
>> On 6/24/05, Yves Vindevogel <yves(dot)vindevogel(at)implements(dot)be> wrote:
>>> So, when I want the last page, which is: 600k / 25 = page 24000 - 1 =
>>> 23999, I issue the offset of 23999 * 25
>>
>> improving this is hard, but not impossible.
>> if you have right index created, try to reverse the order and fetch
>> first adverts, and then resort it (just the 25 adverts) in correct
>> order.
>> it will be faster.
>>
>> depesz
>>
>>
> Met vriendelijke groeten,
> Bien à vous,
> Kind regards,
>
> Yves Vindevogel
> Implements
>

Attachment: Pasted Graphic 2.tiff
Description: image/tiff (5.6 KB)
Attachment: Pasted Graphic 2.tiff
Description: image/tiff (5.6 KB)

Responses

pgsql-performance by date

Next:From: Yves VindevogelDate: 2005-06-24 20:23:43
Subject: Re: Speed with offset clause
Previous:From: PuddleDate: 2005-06-24 19:56:35
Subject: Re: max_connections / shared_buffers / effective_cache_size questions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group