MobilityDB
1.0
|
Functions for selectivity estimation of operators on temporal types whose bounding box is a Period
, that is, tbool
and ttext
.
More...
#include "general/temporal_selfuncs.h"
#include <assert.h>
#include <access/amapi.h>
#include <access/heapam.h>
#include <access/htup_details.h>
#include <access/itup.h>
#include <access/relscan.h>
#include <access/visibilitymap.h>
#include <access/skey.h>
#include <catalog/pg_collation.h>
#include <executor/tuptable.h>
#include <optimizer/paths.h>
#include <storage/bufmgr.h>
#include <utils/builtins.h>
#include <utils/date.h>
#include <utils/datum.h>
#include <utils/memutils.h>
#include <utils/rel.h>
#include <utils/syscache.h>
#include "general/temporal_boxops.h"
#include "general/timetypes.h"
#include "general/timestampset.h"
#include "general/period.h"
#include "general/periodset.h"
#include "general/time_selfuncs.h"
#include "general/rangetypes_ext.h"
#include "general/temporal_analyze.h"
#include "point/tpoint.h"
Functions | |
double | var_eq_const (VariableStatData *vardata, Oid operator, Datum constval, bool constisnull, bool varonleft, bool negate) |
Equal selectivity for var = const case. More... | |
static bool | temporal_const_to_period (Node *other, Period *period) |
Transform the constant into a period. More... | |
static bool | temporal_cachedop (Oid operator, CachedOp *cachedOp) |
Returns the enum value associated to the operator. More... | |
static double | default_temporal_selectivity (CachedOp operator) |
Returns a default selectivity estimate for the operator when we don't have statistics or cannot use them for some reason. More... | |
Selectivity | temporal_sel_internal (PlannerInfo *root, VariableStatData *vardata, Period *period, CachedOp cachedOp) |
Returns an estimate of the selectivity of the search period and the operator for columns of temporal values. More... | |
PGDLLEXPORT Datum | temporal_sel (PG_FUNCTION_ARGS) |
Estimate the selectivity value of the operators for temporal types whose bounding box is a period, that is, tbool and ttext. More... | |
PGDLLEXPORT Datum | temporal_joinsel (PG_FUNCTION_ARGS) |
Functions for selectivity estimation of operators on temporal types whose bounding box is a Period
, that is, tbool
and ttext
.
The operators currently supported are as follows
<
, <=
, >
, >=
&&
, @>
, <@
, ~=
<<#
, &<#
, #>>
, #>>
?=
, %=
, ?<>
, %<>
, ?<,
%<`, ... These still need to be defined. TODODue to implicit casting, a condition such as tbool <<# timestamptz
will be transformed into tbool <<# period
. This allows to reduce the number of cases for the operator definitions, indexes, selectivity, etc.