Re: Speed Up Offset and Limit Clause

From: Guillaume Cottenceau <gc(at)mnc(dot)ch>
To: "Christian Paul Cosinas" <cpc(at)cybees(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Speed Up Offset and Limit Clause
Date: 2006-05-11 06:46:31
Message-ID: 87bqu5t5x4.fsf@meuh.mnc.lan
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Christian Paul Cosinas" <cpc 'at' cybees.com> writes:

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

First you should read the appropriate documentation.

http://www.postgresql.org/docs/8.1/interactive/performance-tips.html

--
Guillaume Cottenceau

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Chris 2006-05-11 06:51:36 Re: Speed Up Offset and Limit Clause
Previous Message Mario Splivalo 2006-05-11 05:32:26 Re: Lot'sa joins - performance tip-up, please?