|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/gist.h"#include "access/reloptions.h"#include "access/stratnum.h"#include "crc32.h"#include "ltree.h"#include "port/pg_bitutils.h"#include "utils/array.h"
Go to the source code of this file.
Data Structures | |
| struct | SPLITCOST |
| struct | LtreeSignature |
Macros | |
| #define | GETENTRY(vec, pos) ((ltree_gist *) DatumGetPointer((vec)->vector[(pos)].key)) |
| #define | NEXTVAL(x) ( (ltree*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) ) |
| #define | WISH_F(a, b, c) (double)( -(double)(((a)-(b))*((a)-(b))*((a)-(b)))*(c) ) |
Typedefs | |
| typedef struct LtreeSignature | LtreeSignature |
| #define GETENTRY | ( | vec, | |
| pos | |||
| ) | ((ltree_gist *) DatumGetPointer((vec)->vector[(pos)].key)) |
Definition at line 26 of file _ltree_gist.c.
Definition at line 27 of file _ltree_gist.c.
Definition at line 29 of file _ltree_gist.c.
|
static |
Definition at line 479 of file _ltree_gist.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_NDIM, array_contains_nulls(), ArrayGetNItems(), ereport, errcode(), errmsg(), ERROR, fb(), gist_qe(), and NEXTVAL.
Referenced by _ltree_consistent().
| Datum _ltree_compress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 49 of file _ltree_gist.c.
References ALOOPBYTE, ARR_DATA_PTR, ARR_DIMS, ARR_NDIM, array_contains_nulls(), ArrayGetNItems(), DatumGetArrayTypeP, DatumGetPointer(), ereport, errcode(), errmsg(), ERROR, fb(), gistentryinit, hashing(), i, GISTENTRY::key, GISTENTRY::leafkey, LTG_ISALLTRUE, LTG_SIGN, LTREE_GET_ASIGLEN, ltree_gist_alloc(), NEXTVAL, GISTENTRY::offset, GISTENTRY::page, palloc_object, PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), GISTENTRY::rel, sign, and val.
| Datum _ltree_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 504 of file _ltree_gist.c.
References _arrq_cons(), DatumGetPointer(), elog, ERROR, gist_qe(), gist_qtxt(), gist_te(), GISTENTRY::key, LTREE_GET_ASIGLEN, PG_DETOAST_DATUM, PG_FREE_IF_COPY, PG_GETARG_DATUM, PG_GETARG_OID, PG_GETARG_POINTER, PG_GETARG_UINT16, and PG_RETURN_BOOL.
| Datum _ltree_gist_options | ( | PG_FUNCTION_ARGS | ) |
Definition at line 547 of file _ltree_gist.c.
References add_local_int_reloption(), fb(), init_local_reloptions(), LTREE_ASIGLEN_DEFAULT, LTREE_ASIGLEN_MAX, PG_GETARG_POINTER, and PG_RETURN_VOID.
| Datum _ltree_penalty | ( | PG_FUNCTION_ARGS | ) |
Definition at line 218 of file _ltree_gist.c.
References DatumGetPointer(), fb(), hemdist(), LTREE_GET_ASIGLEN, newval, PG_GETARG_POINTER, and PG_RETURN_POINTER.
| Datum _ltree_picksplit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 242 of file _ltree_gist.c.
References ALOOPBYTE, comparecost(), fb(), FirstOffsetNumber, GETENTRY, hemdist(), i, j, LTG_ISALLTRUE, LTG_SIGN, LTREE_GET_ASIGLEN, ltree_gist_alloc(), OffsetNumberNext, palloc(), palloc_array, PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), qsort, GIST_SPLITVEC::spl_ldatum, GIST_SPLITVEC::spl_left, GIST_SPLITVEC::spl_nleft, GIST_SPLITVEC::spl_nright, GIST_SPLITVEC::spl_rdatum, GIST_SPLITVEC::spl_right, and WISH_F.
| Datum _ltree_same | ( | PG_FUNCTION_ARGS | ) |
Definition at line 107 of file _ltree_gist.c.
References a, ALOOPBYTE, b, fb(), i, LTG_ISALLTRUE, LTG_SIGN, LTREE_GET_ASIGLEN, PG_GETARG_POINTER, and PG_RETURN_POINTER.
| Datum _ltree_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 154 of file _ltree_gist.c.
References fb(), ltree_gist::flag, GETENTRY, i, LTG_ALLTRUE, LTG_HDRSIZE, LTG_SIGN, LTREE_GET_ASIGLEN, ltree_gist_alloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, SET_VARSIZE(), unionkey(), and VARSIZE().
Definition at line 416 of file _ltree_gist.c.
References AHASHVAL, FLG_CANLOOKSIGN, GETBIT, sig, and val.
Referenced by gist_qtxt().
Definition at line 236 of file _ltree_gist.c.
References a, b, and SPLITCOST::cost.
Referenced by _ltree_picksplit().
|
static |
Definition at line 440 of file _ltree_gist.c.
References AHASHVAL, fb(), GETBIT, LQL_CANLOOKSIGN, LQL_FIRST, LQL_NEXT, LQUERY_FIRST, LTG_ISALLTRUE, LTG_SIGN, LVAR_NEXT, lquery::numlevel, and sign.
Referenced by _arrq_cons(), and _ltree_consistent().
|
static |
Definition at line 424 of file _ltree_gist.c.
References checkcondition_bit(), GETQUERY, LTG_ISALLTRUE, LTG_SIGN, ltree_execute(), sig, and LtreeSignature::sign.
Referenced by _ltree_consistent().
|
static |
Definition at line 387 of file _ltree_gist.c.
References AHASHVAL, fb(), GETBIT, LEVEL_NEXT, LTG_ISALLTRUE, LTG_SIGN, ltree_crc32_sz(), LTREE_FIRST, ltree::numlevel, and sign.
Referenced by _ltree_consistent().
Definition at line 33 of file _ltree_gist.c.
References AHASH, cur, fb(), hash(), LEVEL_NEXT, ltree_crc32_sz(), LTREE_FIRST, cursor::name, ltree::numlevel, and sign.
Referenced by _ltree_compress().
|
static |
Definition at line 201 of file _ltree_gist.c.
References a, ASIGLENBIT, b, hemdistsign(), LTG_ISALLTRUE, LTG_SIGN, and sizebitvec().
Referenced by _ltree_penalty(), and _ltree_picksplit().
| PG_FUNCTION_INFO_V1 | ( | _ltree_compress | ) |
| PG_FUNCTION_INFO_V1 | ( | _ltree_consistent | ) |
| PG_FUNCTION_INFO_V1 | ( | _ltree_gist_options | ) |
| PG_FUNCTION_INFO_V1 | ( | _ltree_penalty | ) |
| PG_FUNCTION_INFO_V1 | ( | _ltree_picksplit | ) |
| PG_FUNCTION_INFO_V1 | ( | _ltree_same | ) |
| PG_FUNCTION_INFO_V1 | ( | _ltree_union | ) |
Definition at line 179 of file _ltree_gist.c.
References pg_popcount(), and sign.
Referenced by hemdist().
|
static |
Definition at line 140 of file _ltree_gist.c.
References ALOOPBYTE, fb(), i, LTG_ISALLTRUE, and LTG_SIGN.
Referenced by _ltree_union().