MobilityDB 1.1

◆ span_bound_bsearch()

static int span_bound_bsearch ( const SpanBound value,
const SpanBound hist,
int  hist_nvalues,
bool  equal 
)
static

Binary search on an array of span bounds.

Return the greatest index of span bound in array which is less (less or equal) than given span bound. If all span bounds in array are greater or equal (greater) than given span bound, return -1. When "equal" flag is set, the conditions in parenthesis are used.

This function is used for scalar operator selectivity estimation. Another goal of this function is to find a histogram bin where to stop interpolation of portion of bounds which are less or equal to given bound.