Re: BUG #14411: Issue with using OFFSET

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: jkoceniak(at)mediamath(dot)com
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14411: Issue with using OFFSET
Date: 2016-11-03 22:52:16
Message-ID: CACjxUsMPONtsFR2VZgseugBOTvvQpo=7aKRap=VfRviZG8yVJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Nov 3, 2016 at 3:29 PM, <jkoceniak(at)mediamath(dot)com> wrote:

> Query performance decreases as the OFFSET increases.

Not a bug, but a fact of life. It must generate the OFFSET number
of rows and continue to generated the next LIMIT rows (or continue
processing until there are no rows). If matching rows are scarce
after OFFSET rows are found, it can take a while to get enough or
to find out that LIMIT rows don't exist.

Personally, I never use OFFSET and LIMIT for pagination; there are
better ways for most situations.

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2016-11-03 23:24:39 Re: Problems with "pg.dropped" column after upgrade 9.5 to 9.6
Previous Message jkoceniak 2016-11-03 20:29:12 BUG #14411: Issue with using OFFSET