1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +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:
Tom Lane
2003-01-27 20:51:54 +00:00
parent b2773d4099
commit 70fba70430
10 changed files with 360 additions and 189 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: cost.h,v 1.50 2003/01/12 22:35:29 tgl Exp $
* $Id: cost.h,v 1.51 2003/01/27 20:51:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -71,18 +71,9 @@ extern void cost_group(Path *path, Query *root,
int numGroupCols, double numGroups,
Cost input_startup_cost, Cost input_total_cost,
double input_tuples);
extern void cost_nestloop(Path *path, Query *root,
Path *outer_path, Path *inner_path,
List *restrictlist);
extern void cost_mergejoin(Path *path, Query *root,
Path *outer_path, Path *inner_path,
List *restrictlist,
List *mergeclauses,
List *outersortkeys, List *innersortkeys);
extern void cost_hashjoin(Path *path, Query *root,
Path *outer_path, Path *inner_path,
List *restrictlist,
List *hashclauses);
extern void cost_nestloop(NestPath *path, Query *root);
extern void cost_mergejoin(MergePath *path, Query *root);
extern void cost_hashjoin(HashPath *path, Query *root);
extern void cost_qual_eval(QualCost *cost, List *quals);
extern void set_baserel_size_estimates(Query *root, RelOptInfo *rel);
extern void set_joinrel_size_estimates(Query *root, RelOptInfo *rel,