MobilityDB  1.0
Functions
time_selfuncs.c File Reference

Functions for selectivity estimation of time types operators. More...

#include "general/time_selfuncs.h"
#include <assert.h>
#include <math.h>
#include <port.h>
#include <access/htup_details.h>
#include <utils/lsyscache.h>
#include <catalog/pg_statistic.h>
#include <utils/timestamp.h>
#include "general/timestampset.h"
#include "general/period.h"
#include "general/periodset.h"
#include "general/timeops.h"
#include "general/time_analyze.h"
#include "general/tempcache.h"
Include dependency graph for time_selfuncs.c:

Functions

static double default_period_selectivity (Oid operator)
 
static bool get_time_cachedop (Oid operator, CachedOp *cachedOp)
 
static double calc_periodsel (VariableStatData *vardata, const Period *constval, Oid operator)
 
double calc_period_hist_selectivity (VariableStatData *vardata, const Period *constval, CachedOp cachedOp)
 
static int period_rbound_bsearch (PeriodBound *value, PeriodBound *hist, int hist_length, bool equal)
 
static float8 get_period_distance (PeriodBound *bound1, PeriodBound *bound2)
 
static float8 get_period_position (PeriodBound *value, PeriodBound *hist1, PeriodBound *hist2)
 
double calc_period_hist_selectivity_scalar (PeriodBound *constbound, PeriodBound *hist, int hist_nvalues, bool equal)
 
int length_hist_bsearch (Datum *length_hist_values, int length_hist_nvalues, double value, bool equal)
 
double get_len_position (double value, double hist1, double hist2)
 
double calc_length_hist_frac (Datum *length_hist_values, int length_hist_nvalues, double length1, double length2, bool equal)
 
double calc_period_hist_selectivity_contained (PeriodBound *lower, PeriodBound *upper, PeriodBound *hist_lower, int hist_nvalues, Datum *length_hist_values, int length_hist_nvalues)
 
double calc_period_hist_selectivity_contains (PeriodBound *lower, PeriodBound *upper, PeriodBound *hist_lower, int hist_nvalues, Datum *length_hist_values, int length_hist_nvalues)
 
double calc_period_hist_selectivity_adjacent (PeriodBound *lower, PeriodBound *upper, PeriodBound *hist_lower, PeriodBound *hist_upper, int hist_nvalues)
 
PGDLLEXPORT Datum periodsel (PG_FUNCTION_ARGS)
 

Detailed Description

Functions for selectivity estimation of time types operators.

These functions are based on those of the file rangetypes_selfuncs.c. Estimates are based on histograms of lower and upper bounds.