1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

Add a back-link from IndexOptInfo structs to their parent RelOptInfo

structs.  There are many places in the planner where we were passing
both a rel and an index to subroutines, and now need only pass the
index struct.  Notationally simpler, and perhaps a tad faster.
This commit is contained in:
Tom Lane
2005-03-27 06:29:49 +00:00
parent febc9a613c
commit 926e8a00d3
11 changed files with 95 additions and 141 deletions

View File

@@ -49,7 +49,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.138 2005/03/06 22:15:04 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.139 2005/03/27 06:29:35 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -227,7 +227,6 @@ cost_nonsequential_access(double relpages)
* but here we consider the cost of just one pass.
*
* 'root' is the query root
* 'baserel' is the base relation the index is for
* 'index' is the index to be used
* 'indexQuals' is the list of applicable qual clauses (implicit AND semantics)
* 'is_injoin' is T if we are considering using the index scan as the inside
@@ -243,11 +242,11 @@ cost_nonsequential_access(double relpages)
*/
void
cost_index(Path *path, Query *root,
RelOptInfo *baserel,
IndexOptInfo *index,
List *indexQuals,
bool is_injoin)
{
RelOptInfo *baserel = index->rel;
Cost startup_cost = 0;
Cost run_cost = 0;
Cost indexStartupCost;