pgsql: Simplify LATERAL-related calculations within add_paths_to_joinre

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Simplify LATERAL-related calculations within add_paths_to_joinre
Date: 2015-12-07 23:56:28
Message-ID: E1a65ds-0006fP-Ck@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify LATERAL-related calculations within add_paths_to_joinrel().

While convincing myself that commit 7e19db0c09719d79 would solve both of
the problems recently reported by Andreas Seltenreich, I realized that
add_paths_to_joinrel's handling of LATERAL restrictions could be made
noticeably simpler and faster if we were to retain the minimum possible
parameterization for each joinrel (that is, the set of relids supplying
unsatisfied lateral references in it). We already retain that for
baserels, in RelOptInfo.lateral_relids, so we can use that field for
joinrels too.

I re-pgindent'd the files touched here, which affects some unrelated
comments.

This is, I believe, just a minor optimization not a bug fix, so no
back-patch.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/edca44b1525b3d591263d032dc4fe500ea771e0e

Modified Files
--------------
src/backend/nodes/outfuncs.c | 2 +-
src/backend/optimizer/path/joinpath.c | 73 +++++++--------------------------
src/backend/optimizer/util/relnode.c | 22 +++++-----
src/include/nodes/relation.h | 18 ++++----
4 files changed, 36 insertions(+), 79 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2015-12-08 17:54:57 pgsql: Allow foreign and custom joins to handle EvalPlanQual rechecks.
Previous Message Alvaro Herrera 2015-12-07 23:07:15 pgsql: PostgresNode: wrap correctly around port number range end