mirror of
https://github.com/postgres/postgres.git
synced 2025-09-06 13:46:51 +03:00
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.
This commit is contained in:
@@ -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
|
||||
@@ -639,6 +639,28 @@ set_differencei(List *l1, List *l2)
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user