summaryrefslogtreecommitdiff
path: root/src/backend/nodes
diff options
context:
space:
mode:
authorTom Lane2003-06-15 22:51:45 +0000
committerTom Lane2003-06-15 22:51:45 +0000
commitcb02610e503957d7ed9b4375537fb6275c16f1fa (patch)
tree540391048748403dc597c35b4cb662d2d4cc3494 /src/backend/nodes
parent3fb6f1347ffbfcbba48b37ea35925f6b19821bf6 (diff)
Adjust nestloop-with-inner-indexscan plan generation so that we catch
some cases of redundant clauses that were formerly not caught. We have to special-case this because the clauses involved never get attached to the same join restrictlist and so the existing logic does not notice that they are redundant.
Diffstat (limited to 'src/backend/nodes')
-rw-r--r--src/backend/nodes/list.c17
-rw-r--r--src/backend/nodes/outfuncs.c6
2 files changed, 21 insertions, 2 deletions
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c
index 207acea9472..7467e1a00e1 100644
--- a/src/backend/nodes/list.c
+++ b/src/backend/nodes/list.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.49 2003/05/28 22:32:49 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.50 2003/06/15 22:51:45 tgl Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle
@@ -359,6 +359,21 @@ llast(List *l)
}
/*
+ * llastnode
+ *
+ * Get the last node of l ... NIL if empty list
+ */
+List *
+llastnode(List *l)
+{
+ if (l == NIL)
+ return NIL;
+ while (lnext(l) != NIL)
+ l = lnext(l);
+ return l;
+}
+
+/*
* freeList
*
* Free the List nodes of a list
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index cec7f09f0a9..f042e8a8d21 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.207 2003/06/06 15:04:02 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.208 2003/06/15 22:51:45 tgl Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
@@ -933,6 +933,7 @@ _outIndexPath(StringInfo str, IndexPath *node)
WRITE_NODE_FIELD(indexinfo);
WRITE_NODE_FIELD(indexqual);
+ WRITE_NODE_FIELD(indexjoinclauses);
WRITE_ENUM_FIELD(indexscandir, ScanDirection);
WRITE_FLOAT_FIELD(rows, "%.2f");
}
@@ -1034,6 +1035,7 @@ _outRestrictInfo(StringInfo str, RestrictInfo *node)
{
WRITE_NODE_TYPE("RESTRICTINFO");
+ /* NB: this isn't a complete set of fields */
WRITE_NODE_FIELD(clause);
WRITE_BOOL_FIELD(ispusheddown);
WRITE_NODE_FIELD(subclauseindices);
@@ -1042,6 +1044,8 @@ _outRestrictInfo(StringInfo str, RestrictInfo *node)
WRITE_OID_FIELD(mergejoinoperator);
WRITE_OID_FIELD(left_sortop);
WRITE_OID_FIELD(right_sortop);
+ WRITE_NODE_FIELD(left_pathkey);
+ WRITE_NODE_FIELD(right_pathkey);
WRITE_OID_FIELD(hashjoinoperator);
}