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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Dept of second thoughts: don't try to push LIMIT below a SRF.
Date: 2010-11-18 16:55:05
Message-ID: E1PJ7lJ-0006xI-Mx@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=48c348f86ce09c668af7cf271757c3f156f28344

Modified Files
--------------
src/backend/executor/nodeLimit.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message User Nanardon 2010-11-18 19:59:52 pgrpm - pgrpm: - fix tag name detection
Previous Message Robert Haas 2010-11-18 15:30:43 pgsql: Minor corrections to dummy_seclabel documentation.