MobilityDB 1.1
Data Structures | Typedefs | Functions
span_spgist.c File Reference
#include <assert.h>
#include <float.h>
#include <postgres.h>
#include <access/spgist.h>
#include <meos.h>
#include <meos_internal.h>
#include "general/set.h"
#include "general/spanset.h"
#include "general/temporal.h"
#include "pg_general/meos_catalog.h"
#include "pg_general/span_gist.h"
#include "pg_general/temporal.h"
Include dependency graph for span_spgist.c:

Data Structures

struct  SortedSpan
 Structure to sort a set of spans of an inner node. More...
 
struct  SpanNode
 Quad-tree SP-GiST index for span types. More...
 

Typedefs

typedef struct SortedSpan SortedSpan
 Structure to sort a set of spans of an inner node. More...
 

Functions

static bool after2D (const SpanNode *nodebox, const Span *query)
 Can any period from nodebox be after the query? More...
 
static bool before2D (const SpanNode *nodebox, const Span *query)
 Can any period from nodebox be before the query? More...
 
PGDLLEXPORT Datum Bigintspan_spgist_config (PG_FUNCTION_ARGS)
 SP-GiST config function for span types. More...
 
static bool contain2D (const SpanNode *nodebox, const Span *query)
 Can any span from nodebox contain the query? More...
 
static double distance_span_nodespan (Span *query, SpanNode *nodebox)
 Distance between a query span and a box of spans. More...
 
PGDLLEXPORT Datum Floatspan_spgist_config (PG_FUNCTION_ARGS)
 SP-GiST config function for span types. More...
 
static uint8 get_quadrant2D (const Span *centroid, const Span *query)
 Calculate the quadrant. More...
 
PGDLLEXPORT Datum Intspan_spgist_config (PG_FUNCTION_ARGS)
 SP-GiST config function for span types. More...
 
static bool left2D (const SpanNode *nodebox, const Span *query)
 Can any span from nodebox be left the query? More...
 
static bool overAfter2D (const SpanNode *nodebox, const Span *query)
 Can any period from nodebox does not extend before the query? More...
 
static bool overBefore2D (const SpanNode *nodebox, const Span *query)
 Can any period from nodebox does not extend after the query? More...
 
static bool overlap2D (const SpanNode *nodebox, const Span *query)
 Can any span from nodebox overlap with this argument? More...
 
static bool overLeft2D (const SpanNode *nodebox, const Span *query)
 Can any span from nodebox does not extend right the query? More...
 
static bool overRight2D (const SpanNode *nodebox, const Span *query)
 Can any span from nodebox does not extend left the query? More...
 
PGDLLEXPORT Datum Period_spgist_config (PG_FUNCTION_ARGS)
 SP-GiST config function for span types. More...
 
static bool right2D (const SpanNode *nodebox, const Span *query)
 Can any span from nodebox be right the query? More...
 
PGDLLEXPORT Datum Set_spgist_compress (PG_FUNCTION_ARGS)
 SP-GiST compress function for timestamp sets. More...
 
PGDLLEXPORT Datum Span_kdtree_choose (PG_FUNCTION_ARGS)
 K-d tree choose function for span types. More...
 
PGDLLEXPORT Datum Span_kdtree_inner_consistent (PG_FUNCTION_ARGS)
 K-d tree inner consistent function for span types. More...
 
PGDLLEXPORT Datum Span_kdtree_picksplit (PG_FUNCTION_ARGS)
 K-d tree pick-split function for span types. More...
 
static int span_level_cmp (Span *centroid, Span *query, int level)
 Determine which half a 2D-mapped span falls into, relative to the centroid and the level number. More...
 
static int span_lower_qsort_cmp (const void *a, const void *b)
 Comparator to sort spans on their lower bound. More...
 
PGDLLEXPORT Datum Span_quadtree_choose (PG_FUNCTION_ARGS)
 SP-GiST choose function for span types. More...
 
PGDLLEXPORT Datum Span_quadtree_inner_consistent (PG_FUNCTION_ARGS)
 Quad-tree inner consistent function for span types. More...
 
PGDLLEXPORT Datum Span_quadtree_picksplit (PG_FUNCTION_ARGS)
 SP-GiST pick-split function for span types. More...
 
static bool span_spgist_get_span (const ScanKeyData *scankey, Span *result)
 Transform a query argument into a span. More...
 
Datum Span_spgist_inner_consistent (FunctionCallInfo fcinfo, SPGistIndexType idxtype)
 Generic SP-GiST inner consistent function for span types. More...
 
PGDLLEXPORT Datum Span_spgist_leaf_consistent (PG_FUNCTION_ARGS)
 SP-GiST leaf-level consistency function for span types. More...
 
static int span_upper_qsort_cmp (const void *a, const void *b)
 Comparator to sort spans on their upper bound. More...
 
SpanNodespannode_copy (const SpanNode *orig)
 Copy a traversal value. More...
 
static void spannode_init (SpanNode *nodebox, meosType spantype, meosType basetype)
 Initialize the traversal value. More...
 
static void spannode_kdtree_next (const SpanNode *nodebox, const Span *centroid, uint8 node, int level, SpanNode *next_nodespan)
 Compute the next traversal value for a k-d tree given the bounding box and the centroid of the current node, the half number (0 or 1), and the level. More...
 
static void spannode_quadtree_next (const SpanNode *nodebox, const Span *centroid, uint8 quadrant, SpanNode *next_nodespan)
 Compute the next traversal value for a quadtree given the bounding box and the centroid of the current node and the quadrant number (0 to 3). More...
 
PGDLLEXPORT Datum Spanset_spgist_compress (PG_FUNCTION_ARGS)
 SP-GiST compress function for period sets. More...