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

Go to the source code of this file.


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 25 of file blcost.c.

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

Referenced by blhandler().

29 {
30  IndexOptInfo *index = path->indexinfo;
31  List *qinfos;
32  GenericCosts costs;
34  /* Do preliminary analysis of indexquals */
35  qinfos = deconstruct_indexquals(path);
37  MemSet(&costs, 0, sizeof(costs));
39  /* We have to visit all index tuples anyway */
40  costs.numIndexTuples = index->tuples;
42  /* Use generic estimate */
43  genericcostestimate(root, path, loop_count, qinfos, &costs);
45  *indexStartupCost = costs.indexStartupCost;
46  *indexTotalCost = costs.indexTotalCost;
47  *indexSelectivity = costs.indexSelectivity;
48  *indexCorrelation = costs.indexCorrelation;
49  *indexPages = costs.numIndexPages;
50 }
Selectivity indexSelectivity
Definition: selfuncs.h:134
IndexOptInfo * indexinfo
Definition: relation.h:1155
#define MemSet(start, val, len)
Definition: c.h:908
double tuples
Definition: relation.h:759
List * deconstruct_indexquals(IndexPath *path)
Definition: selfuncs.c:6552
Definition: type.h:89
Cost indexTotalCost
Definition: selfuncs.h:133
double indexCorrelation
Definition: selfuncs.h:135
double numIndexTuples
Definition: selfuncs.h:139
Cost indexStartupCost
Definition: selfuncs.h:132
Definition: pg_list.h:45
void genericcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, List *qinfos, GenericCosts *costs)
Definition: selfuncs.c:6701
double numIndexPages
Definition: selfuncs.h:138