14#define GETENTRY(vec,pos) ((ArrayType *) DatumGetPointer((vec)->vector[(pos)].key))
24#define MAXNUMELTS (Min((MaxAllocSize / sizeof(Datum)),((MaxAllocSize - ARR_OVERHEAD_NONULLS(1)) / sizeof(int)))/2)
187 errmsg(
"input array is too big (%d maximum allowed, %d current), use gist__intbig_ops opclass instead",
241 for (;
i >= 0;
i--,
j--)
257 while (
len > num_ranges * 2)
260 for (
i = 2;
i <
len;
i += 2)
277 errmsg(
"data is too sparse, recreate index using gist__intbig_ops opclass instead")));
321 if (
lenin < 2 * num_ranges)
339 errmsg(
"compressed array is too big, recreate index using gist__intbig_ops opclass instead")));
348 if ((!
i) || *(
dr - 1) !=
j)
567 for (
j = 0;
j < maxoff;
j++)
633 "number of ranges for compression",
bool inner_int_overlap(ArrayType *a, ArrayType *b)
ArrayType * new_intArrayType(int num)
ArrayType * inner_int_union(ArrayType *a, ArrayType *b)
bool inner_int_contains(ArrayType *a, ArrayType *b)
#define G_INT_GET_NUMRANGES()
int internal_size(int *a, int len)
ArrayType * copy_intArrayType(ArrayType *a)
ArrayType * inner_int_inter(ArrayType *a, ArrayType *b)
void rt__int_size(ArrayType *a, float *size)
#define QSORT(a, direction)
ArrayType * resize_intArrayType(ArrayType *a, int num)
#define BooleanSearchStrategy
bool execconsistent(QUERYTYPE *query, ArrayType *array, bool calcnot)
#define G_INT_NUMRANGES_DEFAULT
#define G_INT_NUMRANGES_MAX
ArrayType * _int_unique(ArrayType *r)
Datum g_int_penalty(PG_FUNCTION_ARGS)
Datum g_int_picksplit(PG_FUNCTION_ARGS)
#define GETENTRY(vec, pos)
Datum g_int_options(PG_FUNCTION_ARGS)
Datum g_int_same(PG_FUNCTION_ARGS)
Datum g_int_compress(PG_FUNCTION_ARGS)
Datum g_int_union(PG_FUNCTION_ARGS)
Datum g_int_decompress(PG_FUNCTION_ARGS)
Datum g_int_consistent(PG_FUNCTION_ARGS)
static int comparecost(const void *a, const void *b)
#define DatumGetArrayTypePCopy(X)
#define PG_GETARG_ARRAYTYPE_P_COPY(n)
#define PG_GETARG_ARRAYTYPE_P(n)
#define DatumGetArrayTypeP(X)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc_object(type)
#define palloc_array(type, count)
#define PG_GETARG_POINTER(n)
#define PG_FUNCTION_INFO_V1(funcname)
#define PG_GETARG_UINT16(n)
#define DirectFunctionCall3(func, arg1, arg2, arg3)
#define PG_RETURN_POINTER(x)
#define PG_RETURN_BOOL(x)
#define gistentryinit(e, k, r, pg, o, l)
void pfree(void *pointer)
#define OffsetNumberNext(offsetNumber)
#define FirstOffsetNumber
#define qsort(a, b, c, d)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
void init_local_reloptions(local_relopts *relopts, Size relopt_struct_size)
void add_local_int_reloption(local_relopts *relopts, const char *name, const char *desc, int default_val, int min_val, int max_val, int offset)
#define RTOldContainsStrategyNumber
#define RTOverlapStrategyNumber
#define RTSameStrategyNumber
#define RTContainsStrategyNumber
#define RTOldContainedByStrategyNumber
#define RTContainedByStrategyNumber
static Size VARSIZE(const void *PTR)