pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christian Paul Cosinas <cpc@cybees.com>
To: pgsql-performance@postgresql.org
Subject: Speed Up Offset and Limit Clause
Date: Thu, 11 May 2006 14:45:33 -0000
Message-ID: <002801c67509$8f1a51a0$1e21100a@ghwk02002147> (raw)
In-Reply-To: <25818.1147310405@sss.pgh.pa.us>

Hi!

How can I speed up my server's performance when I use offset and limit
clause.

For example I have a query:
SELECT * FROM table ORDER BY id, name OFFSET 100000 LIMIT 10000

This query takes a long time about more than 2 minutes.

If my query is:
SELECT * FROM table ORDER BY id, name OFFSET 50000 LIMIT 10000
It takes about 2 seconds.

Thanks




view thread (8+ messages)  latest in thread

Message-ID: <002801c67509$8f1a51a0$1e21100a@ghwk02002147>
Permalink:  ../002801c67509$8f1a51a0$1e21100a@ghwk02002147/
Also on:    postgresql.org/message-id/002801c67509$8f1a51a0$1e21100a@ghwk02002147

 · 

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: cpc@cybees.com
  Subject: Re: Speed Up Offset and Limit Clause
  In-Reply-To: <002801c67509$8f1a51a0$1e21100a@ghwk02002147>

* 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