PostgreSQL Source Code  git master
blcost.c File Reference
#include "postgres.h"
#include "bloom.h"
#include "fmgr.h"
#include "utils/selfuncs.h"
Include dependency graph for blcost.c:

Go to the source code of this file.

Functions

void blcostestimate (PlannerInfo *root, IndexPath *path, double loop_count, Cost *indexStartupCost, Cost *indexTotalCost, Selectivity *indexSelectivity, double *indexCorrelation, double *indexPages)
 

Function Documentation

◆ blcostestimate()

void blcostestimate ( PlannerInfo root,
IndexPath path,
double  loop_count,
Cost indexStartupCost,
Cost indexTotalCost,
Selectivity indexSelectivity,
double *  indexCorrelation,
double *  indexPages 
)

Definition at line 23 of file blcost.c.

References genericcostestimate(), GenericCosts::indexCorrelation, IndexPath::indexinfo, GenericCosts::indexSelectivity, GenericCosts::indexStartupCost, GenericCosts::indexTotalCost, MemSet, GenericCosts::numIndexPages, GenericCosts::numIndexTuples, and IndexOptInfo::tuples.

Referenced by blhandler().

27 {
28  IndexOptInfo *index = path->indexinfo;
29  GenericCosts costs;
30 
31  MemSet(&costs, 0, sizeof(costs));
32 
33  /* We have to visit all index tuples anyway */
34  costs.numIndexTuples = index->tuples;
35 
36  /* Use generic estimate */
37  genericcostestimate(root, path, loop_count, &costs);
38 
39  *indexStartupCost = costs.indexStartupCost;
40  *indexTotalCost = costs.indexTotalCost;
41  *indexSelectivity = costs.indexSelectivity;
42  *indexCorrelation = costs.indexCorrelation;
43  *indexPages = costs.numIndexPages;
44 }
Selectivity indexSelectivity
Definition: selfuncs.h:109
IndexOptInfo * indexinfo
Definition: pathnodes.h:1211
#define MemSet(start, val, len)
Definition: c.h:1004
double tuples
Definition: pathnodes.h:824
Definition: type.h:89
void genericcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, GenericCosts *costs)
Definition: selfuncs.c:6002
Cost indexTotalCost
Definition: selfuncs.h:108
double indexCorrelation
Definition: selfuncs.h:110
double numIndexTuples
Definition: selfuncs.h:114
Cost indexStartupCost
Definition: selfuncs.h:107
double numIndexPages
Definition: selfuncs.h:113