MobilityDB  1.0
Data Structures | Macros | Functions
time_gist.c File Reference

R-tree GiST index for time types. More...

#include "general/time_gist.h"
#include <assert.h>
#include <access/gist.h>
#include <utils/timestamp.h>
#include "general/timetypes.h"
#include "general/timestampset.h"
#include "general/period.h"
#include "general/periodset.h"
#include "general/timeops.h"
#include "general/temporal_util.h"
#include "general/tempcache.h"
Include dependency graph for time_gist.c:

Data Structures

struct  ConsiderSplitContext
 Structure keeping context for the function period_gist_consider_split. More...
 
struct  PeriodBounds
 Structure keeping the bounds extracted from a period, for use in the function period_gist_double_sorting_split. More...
 

Macros

#define PLACE_LEFT(period, off)
 
#define PLACE_RIGHT(period, off)
 

Functions

bool period_index_consistent_leaf (const Period *key, const Period *query, StrategyNumber strategy)
 Leaf-level consistency for time types. More...
 
bool period_gist_consistent_internal (const Period *key, const Period *query, StrategyNumber strategy)
 GiST internal-page consistency for time types. More...
 
bool period_index_recheck (StrategyNumber strategy)
 Returns true if a recheck is necessary depending on the strategy. More...
 
PGDLLEXPORT Datum period_gist_consistent (PG_FUNCTION_ARGS)
 GiST consistent method for time types and alpha temporal types whose bounding box is a period. More...
 
PGDLLEXPORT Datum period_gist_union (PG_FUNCTION_ARGS)
 GiST union method for time types. More...
 
PGDLLEXPORT Datum timestampset_gist_compress (PG_FUNCTION_ARGS)
 GiST compress method for timestamp sets. More...
 
PGDLLEXPORT Datum period_gist_compress (PG_FUNCTION_ARGS)
 GiST compress method for periods. More...
 
PGDLLEXPORT Datum periodset_gist_compress (PG_FUNCTION_ARGS)
 GiST compress method for period sets. More...
 
PGDLLEXPORT Datum period_gist_decompress (PG_FUNCTION_ARGS)
 Decompress method for time types (result in a period) More...
 
PGDLLEXPORT Datum period_gist_penalty (PG_FUNCTION_ARGS)
 GiST page split penalty function for periods. More...
 
static void period_gist_fallback_split (GistEntryVector *entryvec, GIST_SPLITVEC *v)
 Trivial split: half of entries will be placed on one page and the other half on the other page. More...
 
static void period_gist_consider_split (ConsiderSplitContext *context, PeriodBound *right_lower, int min_left_count, PeriodBound *left_upper, int max_left_count)
 Consider replacement of currently selected split with a better one during period_gist_double_sorting_split. More...
 
static int periodbounds_cmp_lower (const void *a, const void *b)
 Compare PeriodBounds by lower bound. More...
 
static int periodbounds_cmp_upper (const void *a, const void *b)
 Compare PeriodBounds by upper bound. More...
 
int common_entry_cmp (const void *i1, const void *i2)
 Compare CommonEntrys by their deltas. More...
 
static void period_gist_double_sorting_split (GistEntryVector *entryvec, GIST_SPLITVEC *v)
 Double sorting split algorithm. More...
 
PGDLLEXPORT Datum period_gist_picksplit (PG_FUNCTION_ARGS)
 GiST picksplit method for time types. More...
 
PGDLLEXPORT Datum period_gist_same (PG_FUNCTION_ARGS)
 GiST same method for time types. More...
 
PGDLLEXPORT Datum period_gist_fetch (PG_FUNCTION_ARGS)
 GiST fetch method for time types (result in a period) More...
 

Detailed Description

R-tree GiST index for time types.

These functions are based on those in the file rangetypes_gist.c.