summaryrefslogtreecommitdiff
path: root/src/include/nodes/pathnodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-02-13 13:35:38 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2023-02-13 13:35:38 -0500
commite9a20e451f3aa0b64da807338012c65d8664d0ac (patch)
treeed030524aca96c5c13e3d3cd3bef3260dbf6310c /src/include/nodes/pathnodes.h
parentc7468c73f7b6e842a53c12eaee5578a76a8fa7a6 (diff)
When removing a relation from the query, drop its RelOptInfo.
In commit b78f6264e I opined that it was "too risky" to delete a relation's RelOptInfo from the planner's data structures when we have realized that we don't need to join to it; so instead we just marked it as a dead relation. In hindsight that judgment seems flawed: any subsequent access to such a dead relation is arguably a bug in itself, so leaving the RelOptInfo present just helps to mask bugs. Let's delete it instead, allowing removal of the whole notion of a "dead relation". So far as the regression tests can find, this requires no other code changes, except for one Assert in equivclass.c that was very dubiously not complaining about access to a dead rel. Discussion: https://postgr.es/m/229905.1676062220@sss.pgh.pa.us
Diffstat (limited to 'src/include/nodes/pathnodes.h')
-rw-r--r--src/include/nodes/pathnodes.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h
index be4d791212c..d61a62da196 100644
--- a/src/include/nodes/pathnodes.h
+++ b/src/include/nodes/pathnodes.h
@@ -638,9 +638,6 @@ typedef struct PartitionSchemeData *PartitionScheme;
* Many of the fields in these RelOptInfos are meaningless, but their Path
* fields always hold Paths showing ways to do that processing step.
*
- * Lastly, there is a RelOptKind for "dead" relations, which are base rels
- * that we have proven we don't need to join after all.
- *
* Parts of this data structure are specific to various scan and join
* mechanisms. It didn't seem worth creating new node types for them.
*
@@ -823,8 +820,7 @@ typedef enum RelOptKind
RELOPT_OTHER_MEMBER_REL,
RELOPT_OTHER_JOINREL,
RELOPT_UPPER_REL,
- RELOPT_OTHER_UPPER_REL,
- RELOPT_DEADREL
+ RELOPT_OTHER_UPPER_REL
} RelOptKind;
/*