Rachit Siamwalla <rachit(at)ensim(dot)com> writes:
> There are 2 items that match the criteria, and you do a LIMIT 2, it
> scans the whole table as well. Limit 1 returns quickly. Basically it
> seems like postgres is looking for one more item than it needs to.
This is not a bug; or at least it's not something I'm prepared to break
other things to change.
If you can figure out a way to change nodeLimit.c to not get confused
about change-of-fetch-direction without the extra fetch, then send a
patch.
regards, tom lane