Re: Poor OFFSET performance in PostgreSQL 9.1.6 - Mailing list pgsql-performance

From hubert depesz lubaczewski
Subject Re: Poor OFFSET performance in PostgreSQL 9.1.6
Date
Msg-id 20130829110022.GA27417@depesz.com
Whole thread Raw
In response to Poor OFFSET performance in PostgreSQL 9.1.6  (<fburgess@radiantblue.com>)
List pgsql-performance
On Wed, Aug 28, 2013 at 01:39:46PM -0700, fburgess@radiantblue.com wrote:
>    Can anyone offer suggestions on how I can optimize a query that contains the LIMIT OFFSET clause?
>    The explain plan of the query is included in the notepad attachment.
>    thanks

large offsets are slow, and there is no real escape from it.

You can change your paging solution, though, to something that will be
faster.

Possible solutions/optimizations:

http://www.depesz.com/2007/08/29/better-results-paging-in-postgresql-82/

or

http://www.depesz.com/2011/05/20/pagination-with-fixed-order/

Best regards,

depesz



pgsql-performance by date:

Previous
From: David Rowley
Date:
Subject: Re: Poor OFFSET performance in PostgreSQL 9.1.6
Next
From: bsreejithin
Date:
Subject: How clustering for scale out works in PostgreSQL