Make UniqueRelInfo a node
d3d55ce571 changed RelOptInfo.unique_for_rels from the list of Relid sets to the list of UniqueRelInfo's. But it didn't make UniqueRelInfo a node. This commit makes UniqueRelInfo a node. Also this commit revises some comments related to RelOptInfo.unique_for_rels. Reported-by: Tom Lane Discussion: https://postgr.es/m/flat/1189851.1698340331%40sss.pgh.pa.us
This commit is contained in:
parent
74604a37f2
commit
2b26a69455
@ -34,20 +34,6 @@
|
|||||||
#include "optimizer/tlist.h"
|
#include "optimizer/tlist.h"
|
||||||
#include "utils/lsyscache.h"
|
#include "utils/lsyscache.h"
|
||||||
|
|
||||||
/*
|
|
||||||
* UniqueRelInfo caches a fact that a relation is unique when being joined
|
|
||||||
* to other relation(s) specified by outerrelids.
|
|
||||||
* 'extra_clauses' contains additional clauses from a baserestrictinfo list that
|
|
||||||
* were used to prove uniqueness. We cache it for the SJ checking procedure: SJ
|
|
||||||
* can be removed if the outer relation contains strictly the same set of
|
|
||||||
* clauses.
|
|
||||||
*/
|
|
||||||
typedef struct UniqueRelInfo
|
|
||||||
{
|
|
||||||
Relids outerrelids;
|
|
||||||
List *extra_clauses;
|
|
||||||
} UniqueRelInfo;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The context for replace_varno_walker() containing source and target relids.
|
* The context for replace_varno_walker() containing source and target relids.
|
||||||
*/
|
*/
|
||||||
|
@ -719,7 +719,7 @@ typedef struct PartitionSchemeData *PartitionScheme;
|
|||||||
* populate these fields, for base rels; but someday they might be used for
|
* populate these fields, for base rels; but someday they might be used for
|
||||||
* join rels too:
|
* join rels too:
|
||||||
*
|
*
|
||||||
* unique_for_rels - list of Relid sets, each one being a set of other
|
* unique_for_rels - list of UniqueRelInfo, each one being a set of other
|
||||||
* rels for which this one has been proven unique
|
* rels for which this one has been proven unique
|
||||||
* non_unique_for_rels - list of Relid sets, each one being a set of
|
* non_unique_for_rels - list of Relid sets, each one being a set of
|
||||||
* other rels for which we have tried and failed to prove
|
* other rels for which we have tried and failed to prove
|
||||||
@ -952,7 +952,7 @@ typedef struct RelOptInfo
|
|||||||
/*
|
/*
|
||||||
* cache space for remembering if we have proven this relation unique
|
* cache space for remembering if we have proven this relation unique
|
||||||
*/
|
*/
|
||||||
/* known unique for these other relid set(s) */
|
/* known unique for these other relid set(s) given in UniqueRelInfo(s) */
|
||||||
List *unique_for_rels;
|
List *unique_for_rels;
|
||||||
/* known not unique for these set(s) */
|
/* known not unique for these set(s) */
|
||||||
List *non_unique_for_rels;
|
List *non_unique_for_rels;
|
||||||
@ -3391,4 +3391,29 @@ typedef struct AggTransInfo
|
|||||||
bool initValueIsNull;
|
bool initValueIsNull;
|
||||||
} AggTransInfo;
|
} AggTransInfo;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* UniqueRelInfo caches a fact that a relation is unique when being joined
|
||||||
|
* to other relation(s).
|
||||||
|
*/
|
||||||
|
typedef struct UniqueRelInfo
|
||||||
|
{
|
||||||
|
pg_node_attr(no_copy_equal, no_read, no_query_jumble)
|
||||||
|
|
||||||
|
NodeTag type;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The relation in consideration is unique when being joined with this set
|
||||||
|
* of other relation(s).
|
||||||
|
*/
|
||||||
|
Relids outerrelids;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Additional clauses from a baserestrictinfo list that were used to prove
|
||||||
|
* the uniqueness. We cache it for the self-join checking procedure: a
|
||||||
|
* self-join can be removed if the outer relation contains strictly the
|
||||||
|
* same set of clauses.
|
||||||
|
*/
|
||||||
|
List *extra_clauses;
|
||||||
|
} UniqueRelInfo;
|
||||||
|
|
||||||
#endif /* PATHNODES_H */
|
#endif /* PATHNODES_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user