diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-02-15 20:49:31 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-02-15 20:49:31 +0000 |
commit | b1577a7c78d2d8880b3c0f94689fb75bd074c897 (patch) | |
tree | c8d8f0500eb2eaa085d921a46a7d0987ba594a4a /src/include/utils/builtins.h | |
parent | 553b5da6a1147881dc1df101ecf9bab75f767ccf (diff) |
New cost model for planning, incorporating a penalty for random page
accesses versus sequential accesses, a (very crude) estimate of the
effects of caching on random page accesses, and cost to evaluate WHERE-
clause expressions. Export critical parameters for this model as SET
variables. Also, create SET variables for the planner's enable flags
(enable_seqscan, enable_indexscan, etc) so that these can be controlled
more conveniently than via PGOPTIONS.
Planner now estimates both startup cost (cost before retrieving
first tuple) and total cost of each path, so it can optimize queries
with LIMIT on a reasonable basis by interpolating between these costs.
Same facility is a win for EXISTS(...) subqueries and some other cases.
Redesign pathkey representation to achieve a major speedup in planning
(I saw as much as 5X on a 10-way join); also minor changes in planner
to reduce memory consumption by recycling discarded Path nodes and
not constructing unnecessary lists.
Minor cleanups to display more-plausible costs in some cases in
EXPLAIN output.
Initdb forced by change in interface to index cost estimation
functions.
Diffstat (limited to 'src/include/utils/builtins.h')
-rw-r--r-- | src/include/utils/builtins.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index cb7ab0e8027..7f9dcc6c469 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.100 2000/02/10 19:51:52 momjian Exp $ + * $Id: builtins.h,v 1.101 2000/02/15 20:49:27 tgl Exp $ * * NOTES * This should normally only be included by fmgr.h. @@ -403,19 +403,23 @@ extern bool convert_to_scalar(Datum value, Oid typid, double *scaleval); extern void btcostestimate(Query *root, RelOptInfo *rel, IndexOptInfo *index, List *indexQuals, - Cost *indexAccessCost, + Cost *indexStartupCost, + Cost *indexTotalCost, Selectivity *indexSelectivity); extern void rtcostestimate(Query *root, RelOptInfo *rel, IndexOptInfo *index, List *indexQuals, - Cost *indexAccessCost, + Cost *indexStartupCost, + Cost *indexTotalCost, Selectivity *indexSelectivity); extern void hashcostestimate(Query *root, RelOptInfo *rel, IndexOptInfo *index, List *indexQuals, - Cost *indexAccessCost, + Cost *indexStartupCost, + Cost *indexTotalCost, Selectivity *indexSelectivity); extern void gistcostestimate(Query *root, RelOptInfo *rel, IndexOptInfo *index, List *indexQuals, - Cost *indexAccessCost, + Cost *indexStartupCost, + Cost *indexTotalCost, Selectivity *indexSelectivity); /* tid.c */ |