1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-19 15:49:24 +03:00

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:
Alexander Korotkov
2023-10-27 05:29:48 +03:00
parent 74604a37f2
commit 2b26a69455
2 changed files with 27 additions and 16 deletions

View File

@@ -34,20 +34,6 @@
#include "optimizer/tlist.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.
*/