1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

Adjust the definition of RestrictInfo's left_relids and right_relids

fields: now they are valid whenever the clause is a binary opclause,
not only when it is a potential join clause (there is a new boolean
field canjoin to signal the latter condition).  This lets us avoid
recomputing the relid sets over and over while examining indexes.
Still more work to do to make this as useful as it could be, because
there are places that could use the info but don't have access to the
RestrictInfo node.
This commit is contained in:
Tom Lane
2003-12-30 23:53:15 +00:00
parent 5e54515167
commit be6c38b903
10 changed files with 104 additions and 83 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.83 2003/11/29 19:51:50 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/joinpath.c,v 1.84 2003/12/30 23:53:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -690,7 +690,7 @@ hash_inner_and_outer(Query *root,
{
RestrictInfo *restrictinfo = (RestrictInfo *) lfirst(i);
if (restrictinfo->left_relids == NULL ||
if (!restrictinfo->canjoin ||
restrictinfo->hashjoinoperator == InvalidOid)
continue; /* not hashjoinable */
@ -809,12 +809,12 @@ select_mergejoin_clauses(RelOptInfo *joinrel,
switch (jointype)
{
case JOIN_RIGHT:
if (restrictinfo->left_relids == NULL ||
if (!restrictinfo->canjoin ||
restrictinfo->mergejoinoperator == InvalidOid)
return NIL; /* not mergejoinable */
break;
case JOIN_FULL:
if (restrictinfo->left_relids == NULL ||
if (!restrictinfo->canjoin ||
restrictinfo->mergejoinoperator == InvalidOid)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
@ -826,7 +826,7 @@ select_mergejoin_clauses(RelOptInfo *joinrel,
}
}
if (restrictinfo->left_relids == NULL ||
if (!restrictinfo->canjoin ||
restrictinfo->mergejoinoperator == InvalidOid)
continue; /* not mergejoinable */