Speed with offset clause - Mailing list pgsql-performance

From Yves Vindevogel
Subject Speed with offset clause
Date
Msg-id 1c365a8bdeb09957fadda7a6fdc8ff02@implements.be
Whole thread Raw
Responses Re: Speed with offset clause
Re: Speed with offset clause
List pgsql-performance
Hi again all,


My queries are now optimised.  They all use the indexes like they
should.

However, there's still a slight problem when I issue the "offset"
clause.


We have a table that contains 600.000 records

We display them by 25 in the webpage.

So, when I want the last page, which is: 600k / 25 = page 24000 - 1 =
23999, I issue the offset of 23999 * 25

This take a long time to run, about 5-10 seconds whereas offset below
100 take less than a second.


Can I speed this up ?



Met vriendelijke groeten,

Bien à vous,

Kind regards,


<bold>Yves Vindevogel</bold>

<bold>Implements</bold>

<smaller>

</smaller>Hi again all,

My queries are now optimised.  They all use the indexes like they
should.
However, there's still a slight problem when I issue the "offset"
clause.

We have a table that contains 600.000 records
We display them by 25 in the webpage.
So, when I want the last page, which is: 600k / 25 = page 24000 - 1 =
23999, I issue the offset of 23999 * 25
This take a long time to run, about 5-10 seconds whereas offset below
100 take less than a second.

Can I speed this up ?

Met vriendelijke groeten,
Bien à vous,
Kind regards,

Yves Vindevogel
Implements

<smaller>


Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91


Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76


Web: http://www.implements.be

<italic><x-tad-smaller>

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.

Mahatma Ghandi.</x-tad-smaller></italic></smaller>


Mail: yves.vindevogel@implements.be  - Mobile: +32 (478) 80 82 91

Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76

Web: http://www.implements.be

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.
Mahatma Ghandi.

Attachment

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgres 8 vs Postgres 7.4/cygwin
Next
From: Puddle
Date:
Subject: max_connections / shared_buffers / effective_cache_size questions