MobilityDB  1.0

◆ calc_hist_selectivity_contains()

static double calc_hist_selectivity_contains ( TypeCacheEntry *  typcache,
RangeBound *  lower,
RangeBound *  upper,
RangeBound *  hist_lower,
int  hist_nvalues,
Datum *  length_hist_values,
int  length_hist_nvalues 
)
static

Calculate selectivity of "var @> const" operator, ie.

estimate the fraction of ranges that contain the constant lower and upper bounds. This uses the histograms of range lower bounds and range lengths, on the assumption that the range lengths are independent of the lower bounds.

Note, this is "var @> const", ie. estimate the fraction of ranges that contain the constant lower and upper bounds.

Note
Function copied from rangetypes_selfuncs.c since it is not exported.