summaryrefslogtreecommitdiff
path: root/src/backend/nodes
diff options
context:
space:
mode:
authorTom Lane2003-01-27 20:51:54 +0000
committerTom Lane2003-01-27 20:51:54 +0000
commit70fba70430bd42b1a31c6d49646f9d1991eb8e7c (patch)
tree865c11bc1262e1fd48067f9b897abf2a50653ddf /src/backend/nodes
parentb2773d4099d2dbccc4d23165a093581090c49451 (diff)
Upgrade cost estimation for joins, per discussion with Bradley Baetz.
Try to model the effect of rescanning input tuples in mergejoins; account for JOIN_IN short-circuiting where appropriate. Also, recognize that mergejoin and hashjoin clauses may now be more than single operator calls, so we have to charge appropriate execution costs.
Diffstat (limited to 'src/backend/nodes')
-rw-r--r--src/backend/nodes/list.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c
index bf9e5c10d6f..1fbfd1efa88 100644
--- a/src/backend/nodes/list.c
+++ b/src/backend/nodes/list.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.45 2003/01/24 03:58:34 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.46 2003/01/27 20:51:49 tgl Exp $
*
* NOTES
* XXX a few of the following functions are duplicated to handle
@@ -640,6 +640,28 @@ set_differencei(List *l1, List *l2)
}
/*
+ * set_ptrDifference
+ *
+ * Same as set_difference, when pointer-equality comparison is sufficient
+ */
+List *
+set_ptrDifference(List *l1, List *l2)
+{
+ List *result = NIL;
+ List *i;
+
+ if (l2 == NIL)
+ return listCopy(l1); /* slightly faster path for empty l2 */
+
+ foreach(i, l1)
+ {
+ if (!ptrMember(lfirst(i), l2))
+ result = lappend(result, lfirst(i));
+ }
+ return result;
+}
+
+/*
* Reverse a list, non-destructively
*/
List *