pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: fburgess@radiantblue.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Poor OFFSET performance in PostgreSQL 9.1.6
Date: Thu, 29 Aug 2013 13:00:22 +0200
Message-ID: <20130829110022.GA27417@depesz.com> (raw)
In-Reply-To: <20130828133946.5a830134ae84016b0174832fdc1a3173.53df957760.wbe@email11.secureserver.net>
References: <20130828133946.5a830134ae84016b0174832fdc1a3173.53df957760.wbe@email11.secureserver.net>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (6+ messages)

Message-ID: <20130829110022.GA27417@depesz.com>
Permalink:  ../20130829110022.GA27417@depesz.com/
Also on:    postgresql.org/message-id/20130829110022.GA27417@depesz.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: depesz@depesz.com, fburgess@radiantblue.com
  Subject: Re: Poor OFFSET performance in PostgreSQL 9.1.6
  In-Reply-To: <20130829110022.GA27417@depesz.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox