PostgreSQL Source Code  git master
blcost.c File Reference
#include "postgres.h"
#include "fmgr.h"
#include "utils/selfuncs.h"
#include "bloom.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 24 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().

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