PostgreSQL Source Code
git master
blcost.c
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* blcost.c
4
* Cost estimate function for bloom indexes.
5
*
6
* Copyright (c) 2016-2023, PostgreSQL Global Development Group
7
*
8
* IDENTIFICATION
9
* contrib/bloom/blcost.c
10
*
11
*-------------------------------------------------------------------------
12
*/
13
#include "
postgres.h
"
14
15
#include "
bloom.h
"
16
#include "
fmgr.h
"
17
#include "
utils/selfuncs.h
"
18
19
/*
20
* Estimate cost of bloom index scan.
21
*/
22
void
23
blcostestimate
(
PlannerInfo
*root,
IndexPath
*path,
double
loop_count,
24
Cost
*indexStartupCost,
Cost
*indexTotalCost,
25
Selectivity
*indexSelectivity,
double
*indexCorrelation,
26
double
*indexPages)
27
{
28
IndexOptInfo
*
index
= path->
indexinfo
;
29
GenericCosts
costs = {0};
30
31
/* We have to visit all index tuples anyway */
32
costs.
numIndexTuples
=
index
->tuples;
33
34
/* Use generic estimate */
35
genericcostestimate
(root, path, loop_count, &costs);
36
37
*indexStartupCost = costs.
indexStartupCost
;
38
*indexTotalCost = costs.
indexTotalCost
;
39
*indexSelectivity = costs.
indexSelectivity
;
40
*indexCorrelation = costs.
indexCorrelation
;
41
*indexPages = costs.
numIndexPages
;
42
}
blcostestimate
void blcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, Cost *indexStartupCost, Cost *indexTotalCost, Selectivity *indexSelectivity, double *indexCorrelation, double *indexPages)
Definition:
blcost.c:23
bloom.h
fmgr.h
Cost
double Cost
Definition:
nodes.h:262
Selectivity
double Selectivity
Definition:
nodes.h:261
postgres.h
genericcostestimate
void genericcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, GenericCosts *costs)
Definition:
selfuncs.c:6501
selfuncs.h
GenericCosts
Definition:
selfuncs.h:120
GenericCosts::indexSelectivity
Selectivity indexSelectivity
Definition:
selfuncs.h:124
GenericCosts::indexStartupCost
Cost indexStartupCost
Definition:
selfuncs.h:122
GenericCosts::indexCorrelation
double indexCorrelation
Definition:
selfuncs.h:125
GenericCosts::indexTotalCost
Cost indexTotalCost
Definition:
selfuncs.h:123
GenericCosts::numIndexPages
double numIndexPages
Definition:
selfuncs.h:128
GenericCosts::numIndexTuples
double numIndexTuples
Definition:
selfuncs.h:129
IndexOptInfo
Definition:
pathnodes.h:1090
IndexPath
Definition:
pathnodes.h:1676
IndexPath::indexinfo
IndexOptInfo * indexinfo
Definition:
pathnodes.h:1678
PlannerInfo
Definition:
pathnodes.h:193
index
Definition:
type.h:95
contrib
bloom
blcost.c
Generated on Tue Nov 28 2023 12:13:13 for PostgreSQL Source Code by
1.9.1