Fix minor nbtree page deletion buffer lock issue.
[pgsql.git] / contrib / bloom / blcost.c
blob54f954dce8c9a5831c8ece4f09f50cc2f1a07fb7
1 /*-------------------------------------------------------------------------
3 * blcost.c
4 * Cost estimate function for bloom indexes.
6 * Copyright (c) 2016-2020, PostgreSQL Global Development Group
8 * IDENTIFICATION
9 * contrib/bloom/blcost.c
11 *-------------------------------------------------------------------------
13 #include "postgres.h"
15 #include "bloom.h"
16 #include "fmgr.h"
17 #include "utils/selfuncs.h"
20 * Estimate cost of bloom index scan.
22 void
23 blcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
24 Cost *indexStartupCost, Cost *indexTotalCost,
25 Selectivity *indexSelectivity, double *indexCorrelation,
26 double *indexPages)
28 IndexOptInfo *index = path->indexinfo;
29 GenericCosts costs;
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;