2 * contrib/btree_gist/btree_interval.c
8#include "utils/fmgrprotos.h"
19/* GiST support functions */
90 * INTERVALSIZE should be the actual size-on-disk of an Interval, as shown
91 * in pg_type. This might be less than sizeof(Interval) if the compiler
92 * insists on adding alignment padding at the end of the struct. (Note:
93 * this concern is obsolete with the current definition of Interval, but
94 * was real before a separate "day" field was added to it.)
96 #define INTERVALSIZE 16
102 32,
/* sizeof(gbtreekey32) */
116 static const Interval zero = {0, 0, 0};
139/**************************************************
140 * GiST support functions
141 **************************************************/
215 /* Oid subtype = PG_GETARG_OID(3); */
220 /* All cases served by this function are exact */
237 /* Oid subtype = PG_GETARG_OID(3); */
245 &
tinfo, fcinfo->flinfo));
274 penalty_num(result, iorg[0], iorg[1], inew[0], inew[1]);
284 &
tinfo, fcinfo->flinfo));
304 /* for leaf items we expect lower == upper, so only compare lower */
Datum interval_gt(PG_FUNCTION_ARGS)
Datum interval_le(PG_FUNCTION_ARGS)
Datum interval_mi(PG_FUNCTION_ARGS)
Datum interval_lt(PG_FUNCTION_ARGS)
Datum interval_cmp(PG_FUNCTION_ARGS)
Datum interval_um(PG_FUNCTION_ARGS)
Datum interval_ge(PG_FUNCTION_ARGS)
Datum interval_eq(PG_FUNCTION_ARGS)
Datum gbt_intv_compress(PG_FUNCTION_ARGS)
static bool gbt_intvge(const void *a, const void *b, FmgrInfo *flinfo)
Datum gbt_intv_decompress(PG_FUNCTION_ARGS)
Interval * abs_interval(Interval *a)
Datum gbt_intv_distance(PG_FUNCTION_ARGS)
static bool gbt_intvle(const void *a, const void *b, FmgrInfo *flinfo)
Datum gbt_intv_fetch(PG_FUNCTION_ARGS)
static int gbt_intv_ssup_cmp(Datum x, Datum y, SortSupport ssup)
Datum gbt_intv_union(PG_FUNCTION_ARGS)
static double intr2num(const Interval *i)
static float8 gbt_intv_dist(const void *a, const void *b, FmgrInfo *flinfo)
Datum gbt_intv_penalty(PG_FUNCTION_ARGS)
Datum gbt_intv_consistent(PG_FUNCTION_ARGS)
static bool gbt_intvgt(const void *a, const void *b, FmgrInfo *flinfo)
static bool gbt_intvlt(const void *a, const void *b, FmgrInfo *flinfo)
static int gbt_intvkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
static const gbtree_ninfo tinfo
Datum gbt_intv_picksplit(PG_FUNCTION_ARGS)
Datum gbt_intv_same(PG_FUNCTION_ARGS)
Datum interval_dist(PG_FUNCTION_ARGS)
static bool gbt_intveq(const void *a, const void *b, FmgrInfo *flinfo)
Datum gbt_intv_sortsupport(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(gbt_intv_compress)
float8 gbt_num_distance(const GBT_NUMKEY_R *key, const void *query, bool is_leaf, const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
bool gbt_num_consistent(const GBT_NUMKEY_R *key, const void *query, const StrategyNumber *strategy, bool is_leaf, const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
bool gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b, const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
GISTENTRY * gbt_num_fetch(GISTENTRY *entry, const gbtree_ninfo *tinfo)
GIST_SPLITVEC * gbt_num_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
void * gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec, const gbtree_ninfo *tinfo, FmgrInfo *flinfo)
#define penalty_num(result, olower, oupper, nlower, nupper)
#define INTERVAL_TO_SEC(ivp)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_RETURN_FLOAT8(x)
#define PG_GETARG_POINTER(n)
#define DirectFunctionCall1(func, arg1)
#define PG_GETARG_DATUM(n)
#define PG_GETARG_UINT16(n)
#define PG_RETURN_POINTER(x)
#define PG_RETURN_BOOL(x)
#define gistentryinit(e, k, r, pg, o, l)
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
static int32 DatumGetInt32(Datum X)
struct SortSupportData * SortSupport
int(* comparator)(Datum x, Datum y, SortSupport ssup)
static Datum IntervalPGetDatum(const Interval *X)
#define PG_GETARG_INTERVAL_P(n)
static Interval * DatumGetIntervalP(Datum X)
#define PG_RETURN_INTERVAL_P(x)