Go to the source code of this file.
|
| #define | G_INT_NUMRANGES_DEFAULT 100 |
| |
| #define | G_INT_NUMRANGES_MAX |
| |
| #define | G_INT_GET_NUMRANGES() |
| |
| #define | ARRPTR(x) ( (int32 *) ARR_DATA_PTR(x) ) |
| |
| #define | ARRNELEMS(x) ArrayGetNItems(ARR_NDIM(x), ARR_DIMS(x)) |
| |
| #define | CHECKARRVALID(x) |
| |
| #define | ARRISEMPTY(x) (ARRNELEMS(x) == 0) |
| |
| #define | SORT(x) |
| |
| #define | PREPAREARR(x) |
| |
| #define | WISH_F(a, b, c) (double)( -(double)(((a)-(b))*((a)-(b))*((a)-(b)))*(c) ) |
| |
| #define | SIGLEN_DEFAULT (63 * 4) |
| |
| #define | SIGLEN_MAX GISTMaxIndexKeySize |
| |
| #define | SIGLENBIT(siglen) ((siglen) * BITS_PER_BYTE) |
| |
| #define | GET_SIGLEN() |
| |
| #define | LOOPBYTE(siglen) for (i = 0; i < siglen; i++) |
| |
| #define | GETBYTE(x, i) ( *( (BITVECP)(x) + (int)( (i) / BITS_PER_BYTE ) ) ) |
| |
| #define | GETBITBYTE(x, i) ( (*((char*)(x)) >> (i)) & 0x01 ) |
| |
| #define | CLRBIT(x, i) GETBYTE(x,i) &= ~( 0x01 << ( (i) % BITS_PER_BYTE ) ) |
| |
| #define | SETBIT(x, i) GETBYTE(x,i) |= ( 0x01 << ( (i) % BITS_PER_BYTE ) ) |
| |
| #define | GETBIT(x, i) ( (GETBYTE(x,i) >> ( (i) % BITS_PER_BYTE )) & 0x01 ) |
| |
| #define | HASHVAL(val, siglen) (((unsigned int)(val)) % SIGLENBIT(siglen)) |
| |
| #define | HASH(sign, val, siglen) SETBIT((sign), HASHVAL(val, siglen)) |
| |
| #define | ALLISTRUE 0x04 |
| |
| #define | ISALLTRUE(x) ( ((GISTTYPE*)x)->flag & ALLISTRUE ) |
| |
| #define | GTHDRSIZE (VARHDRSZ + sizeof(int32)) |
| |
| #define | CALCGTSIZE(flag, siglen) ( GTHDRSIZE+(((flag) & ALLISTRUE) ? 0 : (siglen)) ) |
| |
| #define | GETSIGN(x) ( (BITVECP)( (char*)x+GTHDRSIZE ) ) |
| |
| #define | BooleanSearchStrategy 20 |
| |
| #define | HDRSIZEQT offsetof(QUERYTYPE, items) |
| |
| #define | COMPUTESIZE(size) ( HDRSIZEQT + (size) * sizeof(ITEM) ) |
| |
| #define | QUERYTYPEMAXITEMS ((MaxAllocSize - HDRSIZEQT) / sizeof(ITEM)) |
| |
| #define | GETQUERY(x) ( (x)->items ) |
| |
| #define | END 0 |
| |
| #define | ERR 1 |
| |
| #define | VAL 2 |
| |
| #define | OPR 3 |
| |
| #define | OPEN 4 |
| |
| #define | CLOSE 5 |
| |
| #define | DatumGetQueryTypeP(X) ((QUERYTYPE *) PG_DETOAST_DATUM(X)) |
| |
| #define | DatumGetQueryTypePCopy(X) ((QUERYTYPE *) PG_DETOAST_DATUM_COPY(X)) |
| |
| #define | PG_GETARG_QUERYTYPE_P(n) DatumGetQueryTypeP(PG_GETARG_DATUM(n)) |
| |
| #define | PG_GETARG_QUERYTYPE_P_COPY(n) DatumGetQueryTypePCopy(PG_GETARG_DATUM(n)) |
| |
| #define | QSORT(a, direction) |
| |
|
| void | isort (int32 *a, size_t len, void *arg) |
| |
| ArrayType * | new_intArrayType (int num) |
| |
| ArrayType * | copy_intArrayType (ArrayType *a) |
| |
| ArrayType * | resize_intArrayType (ArrayType *a, int num) |
| |
| int | internal_size (int *a, int len) |
| |
| ArrayType * | _int_unique (ArrayType *r) |
| |
| int32 | intarray_match_first (ArrayType *a, int32 elem) |
| |
| ArrayType * | intarray_add_elem (ArrayType *a, int32 elem) |
| |
| ArrayType * | intarray_concat_arrays (ArrayType *a, ArrayType *b) |
| |
| ArrayType * | int_to_intset (int32 elem) |
| |
| bool | inner_int_overlap (ArrayType *a, ArrayType *b) |
| |
| bool | inner_int_contains (ArrayType *a, ArrayType *b) |
| |
| ArrayType * | inner_int_union (ArrayType *a, ArrayType *b) |
| |
| ArrayType * | inner_int_inter (ArrayType *a, ArrayType *b) |
| |
| void | rt__int_size (ArrayType *a, float *size) |
| |
| void | gensign (BITVECP sign, int *a, int len, int siglen) |
| |
| bool | signconsistent (QUERYTYPE *query, BITVECP sign, int siglen, bool calcnot) |
| |
| bool | execconsistent (QUERYTYPE *query, ArrayType *array, bool calcnot) |
| |
| bool | gin_bool_consistent (QUERYTYPE *query, bool *check) |
| |
| bool | query_has_required_values (QUERYTYPE *query) |
| |
◆ ALLISTRUE
◆ ARRISEMPTY
◆ ARRNELEMS
◆ ARRPTR
◆ BooleanSearchStrategy
| #define BooleanSearchStrategy 20 |
◆ CALCGTSIZE
◆ CHECKARRVALID
Value:
errmsg(
"array must not contain nulls"))); \
} while(0)
bool array_contains_nulls(const ArrayType *array)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
Definition at line 30 of file _int.h.
35 errmsg(
"array must not contain nulls"))); \
36 } while(0)
◆ CLOSE
◆ CLRBIT
◆ COMPUTESIZE
◆ DatumGetQueryTypeP
◆ DatumGetQueryTypePCopy
◆ END
◆ ERR
◆ G_INT_GET_NUMRANGES
| #define G_INT_GET_NUMRANGES |
( |
| ) |
|
Value:
#define G_INT_NUMRANGES_DEFAULT
#define PG_GET_OPCLASS_OPTIONS()
#define PG_HAS_OPCLASS_OPTIONS()
Definition at line 14 of file _int.h.
◆ G_INT_NUMRANGES_DEFAULT
| #define G_INT_NUMRANGES_DEFAULT 100 |
◆ G_INT_NUMRANGES_MAX
Value:
#define GISTMaxIndexKeySize
Definition at line 12 of file _int.h.
◆ GET_SIGLEN
Value:
Definition at line 65 of file _int.h.
◆ GETBIT
◆ GETBITBYTE
◆ GETBYTE
◆ GETQUERY
◆ GETSIGN
◆ GTHDRSIZE
◆ HASH
◆ HASHVAL
◆ HDRSIZEQT
◆ ISALLTRUE
◆ LOOPBYTE
◆ OPEN
◆ OPR
◆ PG_GETARG_QUERYTYPE_P
◆ PG_GETARG_QUERYTYPE_P_COPY
◆ PREPAREARR
Value: do { \
} while(0)
ArrayType * _int_unique(ArrayType *r)
Definition at line 49 of file _int.h.
◆ QSORT
Value:
Definition at line 180 of file _int.h.
◆ QUERYTYPEMAXITEMS
◆ SETBIT
◆ SIGLEN_DEFAULT
| #define SIGLEN_DEFAULT (63 * 4) |
◆ SIGLEN_MAX
◆ SIGLENBIT
◆ SORT
Value:
Definition at line 41 of file _int.h.
◆ VAL
◆ WISH_F
◆ BITVECP
◆ ITEM
◆ QUERYTYPE
◆ _int_unique()
Definition at line 313 of file _int_tool.c.
314{
317
320
322}
static size_t qunique_arg(void *array, size_t elements, size_t width, int(*compare)(const void *, const void *, void *), void *arg)
References ARRNELEMS, ARRPTR, fb(), isort_cmp(), qunique_arg(), and resize_intArrayType().
Referenced by g_int_union(), inner_int_union(), intset_subtract(), intset_union_elem(), and uniq().
◆ copy_intArrayType()
◆ execconsistent()
Definition at line 307 of file _int_bool.c.
308{
310
317}
static bool checkcondition_arr(void *checkval, ITEM *item, void *options)
static bool execute(ITEM *curitem, void *checkval, void *options, bool calcnot, bool(*chkcond)(void *checkval, ITEM *item, void *options))
References ARRNELEMS, ARRPTR, CHECKARRVALID, checkcondition_arr(), execute(), fb(), GETQUERY, and QUERYTYPE::size.
Referenced by g_int_consistent().
◆ gensign()
Definition at line 325 of file _int_tool.c.
326{
328
329
331 {
334 }
335}
#define HASH(sign, val, siglen)
References a, HASH, i, len, and sign.
◆ gin_bool_consistent()
Definition at line 334 of file _int_bool.c.
335{
340
341 if (query->
size <= 0)
342 return false;
343
344
345
346
347
350 for (
i = 0;
i < query->
size;
i++)
351 {
353 gcv.mapped_check[
i] = check[
j++];
354 }
355
359}
static bool checkcondition_gin(void *checkval, ITEM *item, void *options)
#define palloc_array(type, count)
References checkcondition_gin(), execute(), fb(), GETQUERY, i, items, j, palloc_array, QUERYTYPE::size, type, and VAL.
Referenced by ginint4_consistent().
◆ inner_int_contains()
◆ inner_int_inter()
Definition at line 136 of file _int_tool.c.
137{
142 *db,
146 k;
147
150
157
160 {
163 else if (
da[
i] == db[
j])
164 {
165 if (k == 0 ||
dr[k - 1] != db[
j])
169 }
170 else
172 }
173
174 if (k == 0)
175 {
178 }
179 else
181}
void pfree(void *pointer)
References a, ARRISEMPTY, ARRNELEMS, ARRPTR, b, fb(), i, j, Min, new_intArrayType(), pfree(), and resize_intArrayType().
Referenced by _int_inter(), and g_int_picksplit().
◆ inner_int_overlap()
◆ inner_int_union()
Definition at line 79 of file _int_tool.c.
80{
82
85
92
93 if (!r)
94 {
102
105
106
109 {
111 {
114 }
115 else if (
da[
i] < db[
j])
117 else
119 }
120
125
127 }
128
131
132 return r;
133}
References _int_unique(), a, ARRISEMPTY, ARRNELEMS, ARRPTR, b, CHECKARRVALID, copy_intArrayType(), fb(), i, j, new_intArrayType(), and resize_intArrayType().
Referenced by _int_union(), g_int_penalty(), and g_int_picksplit().
◆ int_to_intset()
◆ intarray_add_elem()
◆ intarray_concat_arrays()
◆ intarray_match_first()
◆ internal_size()
◆ isort()
◆ new_intArrayType()
Definition at line 224 of file _int_tool.c.
225{
227 int nbytes;
228
229
230 if (num <= 0)
231 {
234 return r;
235 }
236
238
240
247
248 return r;
249}
#define ARR_OVERHEAD_NONULLS(ndims)
ArrayType * construct_empty_array(Oid elmtype)
#define Assert(condition)
void * palloc0(Size size)
static void SET_VARSIZE(void *PTR, Size len)
References ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, ARR_OVERHEAD_NONULLS, Assert, construct_empty_array(), ArrayType::dataoffset, fb(), palloc0(), and SET_VARSIZE().
Referenced by copy_intArrayType(), g_int_decompress(), g_int_union(), inner_int_inter(), inner_int_union(), int_to_intset(), intarray_add_elem(), intarray_concat_arrays(), intset_subtract(), and subarray().
◆ query_has_required_values()
◆ resize_intArrayType()
Definition at line 252 of file _int_tool.c.
253{
254 int nbytes;
256
257
258 if (num <= 0)
259 {
263 }
264
267
269
271
273
275 {
277 num = 1;
278 }
280}
#define ARR_DATA_OFFSET(a)
void * repalloc(void *pointer, Size size)
References a, ARR_DATA_OFFSET, ARR_DIMS, ARR_NDIM, ARRNELEMS, Assert, construct_empty_array(), fb(), i, repalloc(), and SET_VARSIZE().
Referenced by _int_unique(), g_int_compress(), inner_int_inter(), inner_int_union(), intarray_del_elem(), and intset_subtract().
◆ rt__int_size()
◆ signconsistent()