1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-09 13:09:39 +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

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/orindxpath.c,v 1.66 2005/03/26 23:29:17 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/orindxpath.c,v 1.67 2005/03/27 06:29:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -383,7 +383,7 @@ best_or_subclause_index(Query *root,
}
/* Collect index clauses usable with this index */
indexclauses = group_clauses_by_indexkey_for_or(rel, index, subclause);
indexclauses = group_clauses_by_indexkey_for_or(index, subclause);
/*
* Ignore index if it doesn't match the subclause at all; except
@@ -398,9 +398,9 @@ best_or_subclause_index(Query *root,
continue;
/* Convert clauses to indexquals the executor can handle */
indexquals = expand_indexqual_conditions(rel, index, indexclauses);
indexquals = expand_indexqual_conditions(index, indexclauses);
cost_index(&subclause_path, root, rel, index, indexquals, false);
cost_index(&subclause_path, root, index, indexquals, false);
if (!found || subclause_path.total_cost < *retTotalCost)
{