Speed with offset clause

From: Yves Vindevogel <yves(dot)vindevogel(at)implements(dot)be>
To: pgsql-performance(at)postgresql(dot)org
Subject: Speed with offset clause
Date: 2005-06-24 18:18:48
Message-ID: 1c365a8bdeb09957fadda7a6fdc8ff02@implements.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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,

Yves Vindevogel
Implements

Attachment Content-Type Size
Pasted Graphic 2.tiff image/tiff 5.6 KB

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Puddle 2005-06-24 18:54:31 max_connections / shared_buffers / effective_cache_size questions
Previous Message Tom Lane 2005-06-24 13:40:27 Re: Postgres 8 vs Postgres 7.4/cygwin