From 70fba70430bd42b1a31c6d49646f9d1991eb8e7c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 27 Jan 2003 20:51:54 +0000 Subject: 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. --- src/backend/optimizer/util/pathnode.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'src/backend/optimizer/util/pathnode.c') diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 3e8d37cb289..c11b928b861 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.85 2003/01/22 00:07:00 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.86 2003/01/27 20:51:54 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -743,8 +743,7 @@ create_nestloop_path(Query *root, pathnode->joinrestrictinfo = restrict_clauses; pathnode->path.pathkeys = pathkeys; - cost_nestloop(&pathnode->path, root, outer_path, inner_path, - restrict_clauses); + cost_nestloop(pathnode, root); return pathnode; } @@ -816,14 +815,7 @@ create_mergejoin_path(Query *root, pathnode->outersortkeys = outersortkeys; pathnode->innersortkeys = innersortkeys; - cost_mergejoin(&pathnode->jpath.path, - root, - outer_path, - inner_path, - restrict_clauses, - mergeclauses, - outersortkeys, - innersortkeys); + cost_mergejoin(pathnode, root); return pathnode; } @@ -861,12 +853,7 @@ create_hashjoin_path(Query *root, pathnode->jpath.path.pathkeys = NIL; pathnode->path_hashclauses = hashclauses; - cost_hashjoin(&pathnode->jpath.path, - root, - outer_path, - inner_path, - restrict_clauses, - hashclauses); + cost_hashjoin(pathnode, root); return pathnode; } -- cgit v1.2.3