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
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