aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-12-11 15:52:16 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2015-12-11 15:52:38 -0500
commit4fcf48450d38e28e69e629c779a7866183d8ea41 (patch)
treeadd52b723925917f78354df86efba391351638b4 /src/backend/nodes/copyfuncs.c
parented8bec915ec570bd90d86710392fe0c181fd08fe (diff)
downloadpostgresql-4fcf48450d38e28e69e629c779a7866183d8ea41.tar.gz
postgresql-4fcf48450d38e28e69e629c779a7866183d8ea41.zip
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.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index 26264cbfab4..ba04b7227ca 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -2067,20 +2067,6 @@ _copySpecialJoinInfo(const SpecialJoinInfo *from)
}
/*
- * _copyLateralJoinInfo
- */
-static LateralJoinInfo *
-_copyLateralJoinInfo(const LateralJoinInfo *from)
-{
- LateralJoinInfo *newnode = makeNode(LateralJoinInfo);
-
- COPY_BITMAPSET_FIELD(lateral_lhs);
- COPY_BITMAPSET_FIELD(lateral_rhs);
-
- return newnode;
-}
-
-/*
* _copyAppendRelInfo
*/
static AppendRelInfo *
@@ -4519,9 +4505,6 @@ copyObject(const void *from)
case T_SpecialJoinInfo:
retval = _copySpecialJoinInfo(from);
break;
- case T_LateralJoinInfo:
- retval = _copyLateralJoinInfo(from);
- break;
case T_AppendRelInfo:
retval = _copyAppendRelInfo(from);
break;