PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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.

Functions

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

Function Documentation

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;
33 
34  /* Do preliminary analysis of indexquals */
35  qinfos = deconstruct_indexquals(path);
36 
37  MemSet(&costs, 0, sizeof(costs));
38 
39  /* We have to visit all index tuples anyway */
40  costs.numIndexTuples = index->tuples;
41 
42  /* Use generic estimate */
43  genericcostestimate(root, path, loop_count, qinfos, &costs);
44 
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:131
IndexOptInfo * indexinfo
Definition: relation.h:1031
#define MemSet(start, val, len)
Definition: c.h:857
double tuples
Definition: relation.h:637
List * deconstruct_indexquals(IndexPath *path)
Definition: selfuncs.c:6256
Definition: type.h:90
Cost indexTotalCost
Definition: selfuncs.h:130
double indexCorrelation
Definition: selfuncs.h:132
double numIndexTuples
Definition: selfuncs.h:136
Cost indexStartupCost
Definition: selfuncs.h:129
Definition: pg_list.h:45
void genericcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, List *qinfos, GenericCosts *costs)
Definition: selfuncs.c:6405
double numIndexPages
Definition: selfuncs.h:135