1 /*-------------------------------------------------------------------------
4 * Cost estimate function for bloom indexes.
6 * Copyright (c) 2016-2020, PostgreSQL Global Development Group
9 * contrib/bloom/blcost.c
11 *-------------------------------------------------------------------------
17 #include "utils/selfuncs.h"
20 * Estimate cost of bloom index scan.
23 blcostestimate(PlannerInfo
*root
, IndexPath
*path
, double loop_count
,
24 Cost
*indexStartupCost
, Cost
*indexTotalCost
,
25 Selectivity
*indexSelectivity
, double *indexCorrelation
,
28 IndexOptInfo
*index
= path
->indexinfo
;
31 MemSet(&costs
, 0, sizeof(costs
));
33 /* We have to visit all index tuples anyway */
34 costs
.numIndexTuples
= index
->tuples
;
36 /* Use generic estimate */
37 genericcostestimate(root
, path
, loop_count
, &costs
);
39 *indexStartupCost
= costs
.indexStartupCost
;
40 *indexTotalCost
= costs
.indexTotalCost
;
41 *indexSelectivity
= costs
.indexSelectivity
;
42 *indexCorrelation
= costs
.indexCorrelation
;
43 *indexPages
= costs
.numIndexPages
;