Re: Variable LIMIT and OFFSET in SELECTs - Mailing list pgsql-general

From Tom Lane
Subject Re: Variable LIMIT and OFFSET in SELECTs
Date
Msg-id 5823.1195148708@sss.pgh.pa.us
Whole thread Raw
In response to Re: Variable LIMIT and OFFSET in SELECTs  (Sam Mason <sam@samason.me.uk>)
Responses Re: Variable LIMIT and OFFSET in SELECTs  (Reg Me Please <regmeplease@gmail.com>)
List pgsql-general
Sam Mason <sam@samason.me.uk> writes:
> On Thu, Nov 15, 2007 at 06:08:20PM +0100, Reg Me Please wrote:
>> But then why allowing the LIMIT and the OFFSET as coming from function
>> argument evaluations?

> I believe the query is planned by ignoring the LIMIT and OFFSET.

No, it still knows there will be a LIMIT in effect, but it has to guess
at how tight the limit is.  From memory I think it assumes 10% of the
total rows will be retrieved, which is a compromise to try to avoid
being spectacularly bad for either small or large limits.

            regards, tom lane

pgsql-general by date:

Previous
From: "Martin Gainty"
Date:
Subject: Re: Compiled debugger plug in for windows, any one have it?
Next
From: "Joshua D. Drake"
Date:
Subject: Re: PLpgsql debugger question