pgsql: Account for SRFs in targetlists in planner rowcount estimates.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Account for SRFs in targetlists in planner rowcount estimates.
Date: 2012-07-21 21:45:35
Message-ID: E1SshUV-0007n1-P7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Account for SRFs in targetlists in planner rowcount estimates.

We made use of the ROWS estimate for set-returning functions used in FROM,
but not for those used in SELECT targetlists; which is a bit of an
oversight considering there are common usages that require the latter
approach. Improve that. (I had initially thought it might be worth
folding this into cost_qual_eval, but after investigation concluded that
that wouldn't be very helpful, so just do it separately.) Per complaint
from David Johnston.

Back-patch to 9.2, but not further, for fear of destabilizing plan choices
in existing releases.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/31c7c642b6419b43eff903285e3da65e3f1901d6

Modified Files
--------------
src/backend/optimizer/path/costsize.c | 9 +++-
src/backend/optimizer/plan/createplan.c | 29 ++++--------
src/backend/optimizer/plan/planagg.c | 6 +--
src/backend/optimizer/plan/planner.c | 78 ++++++++++++++++++++++--------
src/backend/optimizer/util/clauses.c | 42 +++++++++++++++-
src/include/optimizer/clauses.h | 1 +
src/include/optimizer/planner.h | 3 +
7 files changed, 120 insertions(+), 48 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-07-21 23:39:17 pgsql: Suppress volatile-related warning seen in some compilers.
Previous Message Robert Haas 2012-07-21 02:32:15 pgsql: Revert temporary patch to debug Windows breakage.