Dept of second thoughts: don't try to push LIMIT below a SRF.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 48c348f86ce09c668af7cf271757c3f156f28344
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-11-18T16:54:34Z
Releases: 9.1.0
Dept of second thoughts: don't try to push LIMIT below a SRF.

If we have Limit->Result->Sort, the Result might be projecting a tlist
that contains a set-returning function.  If so, it's possible for the
SRF to sometimes return zero rows, which means we could need to fetch
more than N rows from the Sort in order to satisfy LIMIT N.
So top-N sorting cannot be used in this scenario.

Files

PathChange+/−
src/backend/executor/nodeLimit.c modified +14 −1