aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/joinpath.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-12-30 23:53:15 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-12-30 23:53:15 +0000
commitbe6c38b9033c546e2a8a9fab4329b89be57a263b (patch)
tree521c34b2c94d52614160a5582654751e089b226e /src/backend/optimizer/path/joinpath.c
parent5e545151671fa4ab3cf0e62ffd1e207609ad1517 (diff)
downloadpostgresql-be6c38b9033c546e2a8a9fab4329b89be57a263b.tar.gz
postgresql-be6c38b9033c546e2a8a9fab4329b89be57a263b.zip
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.
Diffstat (limited to 'src/backend/optimizer/path/joinpath.c')
-rw-r--r--src/backend/optimizer/path/joinpath.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c
index 5b95ec7c4dd..91cd0ab22a5 100644
--- a/src/backend/optimizer/path/joinpath.c
+++ b/src/backend/optimizer/path/joinpath.c
@@ -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 */