Re: BUG #7918: limitation of pagination with LIMIT and OFFSET

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "adrianopatrick(at)gmail(dot)com" <adrianopatrick(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #7918: limitation of pagination with LIMIT and OFFSET
Date: 2013-03-06 17:34:29
Message-ID: 1362591269.94284.YahooMailNeo@web162903.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"adrianopatrick(at)gmail(dot)com" <adrianopatrick(at)gmail(dot)com> wrote:

> I need to process a query, the query returned as somewhere around
> 20 million records, I thought to do with LIMIT and OFFSET where
> the limit is fixed for 5000 records and will incrementing the
> OFFSET, but when reached OFFSET 400 000 consultation was very
> slow, taking almost the time of the query without LIMIT and
> OFFSET.

You should probably use a cursor instead of LIMIT and OFFSET.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-03-06 18:33:35 Re: BUG #7914: pg_dump aborts occasionally
Previous Message Tom Lane 2013-03-06 15:48:08 Re: BUG #7920: Sequence rename leave stale value for sequence_name