PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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-2026, 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 "utils/selfuncs.h"
17
18/*
19 * Estimate cost of bloom index scan.
20 */
21void
23 Cost *indexStartupCost, Cost *indexTotalCost,
24 Selectivity *indexSelectivity, double *indexCorrelation,
25 double *indexPages)
26{
28 GenericCosts costs = {0};
29
30 /* We have to visit all index tuples anyway */
31 costs.numIndexTuples = index->tuples;
32
33 /* Use generic estimate */
34 genericcostestimate(root, path, loop_count, &costs);
35
36 *indexStartupCost = costs.indexStartupCost;
37 *indexTotalCost = costs.indexTotalCost;
38 *indexSelectivity = costs.indexSelectivity;
39 *indexCorrelation = costs.indexCorrelation;
41}
void blcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, Cost *indexStartupCost, Cost *indexTotalCost, Selectivity *indexSelectivity, double *indexCorrelation, double *indexPages)
Definition blcost.c:22
double Cost
Definition nodes.h:261
double Selectivity
Definition nodes.h:260
static int fb(int x)
tree ctl root
Definition radixtree.h:1857
void genericcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, GenericCosts *costs)
Definition selfuncs.c:7395
Selectivity indexSelectivity
Definition selfuncs.h:129
Cost indexStartupCost
Definition selfuncs.h:127
double indexCorrelation
Definition selfuncs.h:130
Cost indexTotalCost
Definition selfuncs.h:128
double numIndexPages
Definition selfuncs.h:133
double numIndexTuples
Definition selfuncs.h:134
IndexOptInfo * indexinfo
Definition pathnodes.h:2036
Definition type.h:96