Sam Mason <sam@xxxxxxxxxxxxx> 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 ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq