Skip site navigation (1) Skip section navigation (2)

Re: BUG #6483: Rows being evaluated, although being outside the LIMIT / OFFSET boundaries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: kouber(at)saparev(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6483: Rows being evaluated, although being outside the LIMIT / OFFSET boundaries
Date: 2012-02-23 16:18:15
Message-ID: 14925.1330013895@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Marti Raudsepp <marti(at)juffo(dot)org> writes:
> AFAICT, the model in the documentation suggests that the SELECT fields
> are evaluated for all matching rows in indeterminate order, before
> ORDER BY is applied and before the result set is sliced by
> OFFSET/LIMIT.

That is in fact the case if you have a query plan that involves a Sort
node followed by Limit.  We have some optimizations that avoid the need
for an explicit sort, but it would be pretty hard to write a
specification for exactly when unretrieved rows will not be evaluated.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2012-02-23 16:21:16
Subject: Re: BUG #6485: Primary index key not updated uniformly
Previous:From: Kouber SaparevDate: 2012-02-23 09:23:30
Subject: Re: BUG #6483: Rows being evaluated, although being outside the LIMIT / OFFSET boundaries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group