pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #7918: limitation of pagination with LIMIT and OFFSET
2+ messages / 2 participants
[nested] [flat]
* BUG #7918: limitation of pagination with LIMIT and OFFSET
@ 2013-03-06 02:42 adrianopatrick@gmail.com
0 siblings, 1 reply; 2+ messages in thread
From: adrianopatrick@gmail.com @ 2013-03-06 02:42 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 7918
Logged by: Adriano Patrick do Nascimento Cunha
Email address: adrianopatrick@gmail.com
PostgreSQL version: 8.4.7
Operating system: Windows/Linux
Description:
Hello guys, today 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. I noticed that when the OFFSET is less
than 400 000 the query execution plan is, but when this value exceeds the
execution plan for the query changes and the query is too long.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #7918: limitation of pagination with LIMIT and OFFSET
@ 2013-03-06 17:34 Kevin Grittner <kgrittn@ymail.com>
parent: adrianopatrick@gmail.com
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Grittner @ 2013-03-06 17:34 UTC (permalink / raw)
To: adrianopatrick@gmail.com <adrianopatrick@gmail.com>; pgsql-bugs
"adrianopatrick@gmail.com" <adrianopatrick@gmail.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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2013-03-06 17:34 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-03-06 02:42 BUG #7918: limitation of pagination with LIMIT and OFFSET adrianopatrick@gmail.com
2013-03-06 17:34 ` Kevin Grittner <kgrittn@ymail.com>
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