pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Get rid of the planner's LateralJoinInfo data structure. 2+ messages / 1 participants [nested] [flat]
* pgsql: Get rid of the planner's LateralJoinInfo data structure. @ 2015-12-11 20:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2015-12-11 20:53 UTC (permalink / raw) To: pgsql-committers Get rid of the planner's LateralJoinInfo data structure. I originally modeled this data structure on SpecialJoinInfo, but after commit acfcd45cacb6df23 that looks like a pretty poor decision. All we really need is relid sets identifying laterally-referenced rels; and most of the time, what we want to know about includes indirect lateral references, a case the LateralJoinInfo data was unsuited to compute with any efficiency. The previous commit redefined RelOptInfo.lateral_relids as the transitive closure of lateral references, so that it easily supports checking indirect references. For the places where we really do want just direct references, add a new RelOptInfo field direct_lateral_relids, which is easily set up as a copy of lateral_relids before we perform the transitive closure calculation. Then we can just drop lateral_info_list and LateralJoinInfo and the supporting code. This makes the planner's handling of lateral references noticeably more efficient, and shorter too. Such a change can't be back-patched into stable branches for fear of breaking extensions that might be looking at the planner's data structures; but it seems not too late to push it into 9.5, so I've done so. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/4fcf48450d38e28e69e629c779a7866183d8ea41 Modified Files -------------- src/backend/nodes/copyfuncs.c | 17 --- src/backend/nodes/equalfuncs.c | 12 --- src/backend/nodes/outfuncs.c | 14 +-- src/backend/optimizer/path/joinrels.c | 36 ++----- src/backend/optimizer/plan/analyzejoins.c | 3 - src/backend/optimizer/plan/initsplan.c | 162 ++++++++++------------------- src/backend/optimizer/plan/planagg.c | 3 +- src/backend/optimizer/plan/planmain.c | 6 +- src/backend/optimizer/plan/planner.c | 3 +- src/backend/optimizer/prep/prepjointree.c | 9 +- src/backend/optimizer/prep/prepunion.c | 1 - src/backend/optimizer/util/placeholder.c | 60 +++-------- src/backend/optimizer/util/relnode.c | 17 +++ src/backend/optimizer/util/var.c | 1 - src/backend/rewrite/rewriteManip.c | 3 - src/include/nodes/nodes.h | 1 - src/include/nodes/relation.h | 41 +------- 17 files changed, 100 insertions(+), 289 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Get rid of the planner's LateralJoinInfo data structure. @ 2015-12-11 20:53 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2015-12-11 20:53 UTC (permalink / raw) To: pgsql-committers Get rid of the planner's LateralJoinInfo data structure. I originally modeled this data structure on SpecialJoinInfo, but after commit acfcd45cacb6df23 that looks like a pretty poor decision. All we really need is relid sets identifying laterally-referenced rels; and most of the time, what we want to know about includes indirect lateral references, a case the LateralJoinInfo data was unsuited to compute with any efficiency. The previous commit redefined RelOptInfo.lateral_relids as the transitive closure of lateral references, so that it easily supports checking indirect references. For the places where we really do want just direct references, add a new RelOptInfo field direct_lateral_relids, which is easily set up as a copy of lateral_relids before we perform the transitive closure calculation. Then we can just drop lateral_info_list and LateralJoinInfo and the supporting code. This makes the planner's handling of lateral references noticeably more efficient, and shorter too. Such a change can't be back-patched into stable branches for fear of breaking extensions that might be looking at the planner's data structures; but it seems not too late to push it into 9.5, so I've done so. Branch ------ REL9_5_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/dc4518814ecc2ae319c4d1679ee079e47dbd78e9 Modified Files -------------- src/backend/nodes/copyfuncs.c | 17 --- src/backend/nodes/equalfuncs.c | 12 --- src/backend/nodes/outfuncs.c | 14 +-- src/backend/optimizer/path/joinrels.c | 36 ++----- src/backend/optimizer/plan/analyzejoins.c | 3 - src/backend/optimizer/plan/initsplan.c | 162 ++++++++++------------------- src/backend/optimizer/plan/planagg.c | 3 +- src/backend/optimizer/plan/planmain.c | 6 +- src/backend/optimizer/plan/planner.c | 3 +- src/backend/optimizer/prep/prepjointree.c | 9 +- src/backend/optimizer/prep/prepunion.c | 1 - src/backend/optimizer/util/placeholder.c | 60 +++-------- src/backend/optimizer/util/relnode.c | 17 +++ src/backend/optimizer/util/var.c | 1 - src/backend/rewrite/rewriteManip.c | 3 - src/include/nodes/nodes.h | 1 - src/include/nodes/relation.h | 41 +------- 17 files changed, 100 insertions(+), 289 deletions(-) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2015-12-11 20:53 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2015-12-11 20:53 pgsql: Get rid of the planner's LateralJoinInfo data structure. Tom Lane <tgl@sss.pgh.pa.us> 2015-12-11 20:53 pgsql: Get rid of the planner's LateralJoinInfo data structure. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox