summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/joininfo.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-08-16 02:17:58 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-08-16 02:17:58 +0000
commite6381966c1886badbc19c94ac1f1ffbc104125ab (patch)
tree9da3d5d073dcb4cff68bdb69f6118409b5315512 /src/backend/optimizer/util/joininfo.c
parent08320bfb22b3ef006885de91f5163ef5fe831889 (diff)
Major planner/optimizer revision: get rid of PathOrder node type,
store all ordering information in pathkeys lists (which are now lists of lists of PathKeyItem nodes, not just lists of lists of vars). This was a big win --- the code is smaller and IMHO more understandable than it was, even though it handles more cases. I believe the node changes will not force an initdb for anyone; planner nodes don't show up in stored rules.
Diffstat (limited to 'src/backend/optimizer/util/joininfo.c')
-rw-r--r--src/backend/optimizer/util/joininfo.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/src/backend/optimizer/util/joininfo.c b/src/backend/optimizer/util/joininfo.c
index 3420313c98c..13d1f6b9fb2 100644
--- a/src/backend/optimizer/util/joininfo.c
+++ b/src/backend/optimizer/util/joininfo.c
@@ -7,14 +7,13 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.23 1999/07/16 04:59:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/joininfo.c,v 1.24 1999/08/16 02:17:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
-#include "optimizer/clauses.h"
#include "optimizer/joininfo.h"
@@ -51,8 +50,8 @@ joininfo_member(List *join_relids, List *joininfo_list)
/*
* find_joininfo_node
* Find the joininfo node within a relation entry corresponding
- * to a join between 'this_rel' and the relations in 'join_relids'. A
- * new node is created and added to the relation entry's joininfo
+ * to a join between 'this_rel' and the relations in 'join_relids'.
+ * A new node is created and added to the relation entry's joininfo
* field if the desired one can't be found.
*
* Returns a joininfo node.
@@ -69,40 +68,7 @@ find_joininfo_node(RelOptInfo *this_rel, Relids join_relids)
joininfo = makeNode(JoinInfo);
joininfo->unjoined_relids = join_relids;
joininfo->jinfo_restrictinfo = NIL;
- joininfo->mergejoinable = false;
- joininfo->hashjoinable = false;
this_rel->joininfo = lcons(joininfo, this_rel->joininfo);
}
return joininfo;
}
-
-/*
- * other_join_clause_var
- * Determines whether a var node is contained within a joinclause
- * of the form(op var var).
- *
- * Returns the other var node in the joinclause if it is, nil if not.
- *
- */
-Var *
-other_join_clause_var(Var *var, Expr *clause)
-{
- Var *retval;
- Var *l,
- *r;
-
- retval = (Var *) NULL;
-
- if (var != NULL && is_joinable((Node *) clause))
- {
- l = (Var *) get_leftop(clause);
- r = (Var *) get_rightop(clause);
-
- if (equal(var, l))
- retval = r;
- else if (equal(var, r))
- retval = l;
- }
-
- return retval;
-}