Skip to content

Commit 926e8a0

Browse files
committed
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.
1 parent febc9a6 commit 926e8a0

File tree

11 files changed

+95
-141
lines changed

11 files changed

+95
-141
lines changed

src/backend/optimizer/path/costsize.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* Portions Copyright (c) 1994, Regents of the University of California
5050
*
5151
* IDENTIFICATION
52-
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.138 2005/03/06 22:15:04 tgl Exp $
52+
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.139 2005/03/27 06:29:35 tgl Exp $
5353
*
5454
*-------------------------------------------------------------------------
5555
*/
@@ -227,7 +227,6 @@ cost_nonsequential_access(double relpages)
227227
* but here we consider the cost of just one pass.
228228
*
229229
* 'root' is the query root
230-
* 'baserel' is the base relation the index is for
231230
* 'index' is the index to be used
232231
* 'indexQuals' is the list of applicable qual clauses (implicit AND semantics)
233232
* 'is_injoin' is T if we are considering using the index scan as the inside
@@ -243,11 +242,11 @@ cost_nonsequential_access(double relpages)
243242
*/
244243
void
245244
cost_index(Path *path, Query *root,
246-
RelOptInfo *baserel,
247245
IndexOptInfo *index,
248246
List *indexQuals,
249247
bool is_injoin)
250248
{
249+
RelOptInfo *baserel = index->rel;
251250
Cost startup_cost = 0;
252251
Cost run_cost = 0;
253252
Cost indexStartupCost;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy