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 "utils/array.h"
Go to the source code of this file.
Data Structures | |
struct | rix |
struct | LtreeSignature |
Macros | |
#define | NEXTVAL(x) ( (lquery*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) ) |
#define | ISEQ(a, b) ( (a)->numlevel == (b)->numlevel && ltree_compare(a,b)==0 ) |
#define | GETENTRY(vec, pos) ((ltree_gist *) DatumGetPointer((vec)->vector[(pos)].key)) |
Typedefs | |
typedef struct rix | RIX |
typedef struct LtreeSignature | LtreeSignature |
#define GETENTRY | ( | vec, | |
pos | |||
) | ((ltree_gist *) DatumGetPointer((vec)->vector[(pos)].key)) |
Definition at line 91 of file ltree_gist.c.
Definition at line 16 of file ltree_gist.c.
Definition at line 15 of file ltree_gist.c.
typedef struct LtreeSignature LtreeSignature |
|
static |
Definition at line 592 of file ltree_gist.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_NDIM, array_contains_nulls(), ArrayGetNItems(), ereport, errcode(), errmsg(), ERROR, gist_between(), gist_qe(), sort-test::key, and NEXTVAL.
Referenced by ltree_consistent().
Definition at line 568 of file ltree_gist.c.
References FLG_CANLOOKSIGN, GETBIT, HASHVAL, sig, and val.
Referenced by gist_qtxt().
Definition at line 445 of file ltree_gist.c.
References palloc0(), and VARSIZE.
Referenced by gist_ischild().
|
static |
Definition at line 547 of file ltree_gist.c.
References lquery::firstgood, gist_tqcmp(), sort-test::key, LTG_GETLNODE, and LTG_GETRNODE.
Referenced by arrq_cons(), and ltree_consistent().
|
static |
Definition at line 454 of file ltree_gist.c.
References copy_ltree(), sort-test::key, LTG_GETLNODE, LTG_GETRNODE, ltree_compare(), ltree::numlevel, pfree(), and res.
Referenced by ltree_consistent().
|
static |
Definition at line 424 of file ltree_gist.c.
References i, sort-test::key, LTG_GETLNODE, LTG_GETRNODE, ltree_compare(), and ltree::numlevel.
Referenced by ltree_consistent().
|
static |
Definition at line 479 of file ltree_gist.c.
References GETBIT, HASHVAL, sort-test::key, LQL_CANLOOKSIGN, LQL_FIRST, LQL_NEXT, LQUERY_FIRST, LTG_ISALLTRUE, LTG_SIGN, LVAR_NEXT, lquery::numlevel, lquery_level::numvar, sign, and lquery_variant::val.
Referenced by arrq_cons(), and ltree_consistent().
|
static |
Definition at line 576 of file ltree_gist.c.
References checkcondition_bit(), GETQUERY, sort-test::key, LTG_ISALLTRUE, LTG_SIGN, ltree_execute(), and sig.
Referenced by ltree_consistent().
Definition at line 518 of file ltree_gist.c.
References lquery::firstgood, ltree_level::len, lquery_variant::len, LEVEL_NEXT, LQL_FIRST, LQL_NEXT, LQUERY_FIRST, LTREE_FIRST, Min, ltree_level::name, lquery_variant::name, ltree::numlevel, and res.
Referenced by gist_between().
Definition at line 176 of file ltree_gist.c.
References cur, HASH, hash(), LEVEL_NEXT, ltree_crc32_sz(), LTREE_FIRST, cursor::name, ltree::numlevel, and sign.
Referenced by ltree_picksplit(), and ltree_union().
Datum ltree_compress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 94 of file ltree_gist.c.
References DatumGetLtreeP, gistentryinit, GISTENTRY::key, sort-test::key, GISTENTRY::leafkey, ltree_gist_alloc(), GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), GISTENTRY::rel, and val.
Datum ltree_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 617 of file ltree_gist.c.
References arrq_cons(), BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, DatumGetBool(), DatumGetPointer(), DirectFunctionCall2, elog, ERROR, gist_between(), gist_ischild(), gist_isparent(), GIST_LEAF, gist_qe(), gist_qtxt(), inner_isparent(), GISTENTRY::key, sort-test::key, lt_q_regex(), LTG_GETLNODE, LTG_GETRNODE, LTG_NODE, ltq_regex(), ltree_compare(), LTREE_GET_SIGLEN, ltxtq_exec(), PG_FREE_IF_COPY, PG_GETARG_ARRAYTYPE_P, PG_GETARG_LQUERY_P, PG_GETARG_LTREE_P, PG_GETARG_LTREE_P_COPY, PG_GETARG_LTXTQUERY_P, PG_GETARG_POINTER, PG_GETARG_UINT16, PG_RETURN_BOOL, PointerGetDatum(), and res.
Datum ltree_decompress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 113 of file ltree_gist.c.
References gistentryinit, GISTENTRY::key, sort-test::key, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_DETOAST_DATUM, PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), and GISTENTRY::rel.
ltree_gist* ltree_gist_alloc | ( | bool | isalltrue, |
BITVECP | sign, | ||
int | siglen, | ||
ltree * | left, | ||
ltree * | right | ||
) |
Definition at line 42 of file ltree_gist.c.
References Assert, ltree_gist::flag, ISEQ, LTG_ALLTRUE, LTG_HDRSIZE, LTG_LNODE, LTG_NODE, LTG_NORIGHT, LTG_ONENODE, LTG_RNODE, LTG_SIGN, palloc(), SET_VARSIZE, sign, size, and VARSIZE.
Referenced by _ltree_compress(), _ltree_picksplit(), _ltree_union(), ltree_compress(), ltree_picksplit(), and ltree_union().
Datum ltree_gist_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 22 of file ltree_gist.c.
References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.
Datum ltree_gist_options | ( | PG_FUNCTION_ARGS | ) |
Definition at line 735 of file ltree_gist.c.
References add_local_int_reloption(), init_local_reloptions(), INTALIGN, ltree_gist_relopts_validator(), LTREE_SIGLEN_DEFAULT, LTREE_SIGLEN_MAX, PG_GETARG_POINTER, PG_RETURN_VOID, and register_reloptions_validator().
Datum ltree_gist_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 32 of file ltree_gist.c.
References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.
|
static |
Definition at line 723 of file ltree_gist.c.
References ereport, errcode(), errmsg(), ERROR, and INTALIGN.
Referenced by ltree_gist_options().
Datum ltree_penalty | ( | PG_FUNCTION_ARGS | ) |
Definition at line 261 of file ltree_gist.c.
References DatumGetPointer(), sort-test::key, LTG_GETLNODE, LTG_GETRNODE, ltree_compare(), LTREE_GET_SIGLEN, Max, newval, PG_GETARG_POINTER, and PG_RETURN_POINTER.
Datum ltree_picksplit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 294 of file ltree_gist.c.
References FirstOffsetNumber, GETENTRY, hashing(), i, rix::index, j, LOOPBYTE, LTG_GETLNODE, LTG_GETRNODE, LTG_ISALLTRUE, LTG_ISONENODE, LTG_NODE, LTG_SIGN, ltree_compare(), LTREE_GET_SIGLEN, ltree_gist_alloc(), GistEntryVector::n, OffsetNumberNext, palloc(), palloc0(), pfree(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), qsort, rix::r, 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 treekey_cmp().
Datum ltree_same | ( | PG_FUNCTION_ARGS | ) |
Definition at line 131 of file ltree_gist.c.
References a, b, i, ISEQ, LOOPBYTE, LTG_ISALLTRUE, LTG_ISONENODE, LTG_LNODE, LTG_NODE, LTG_RNODE, LTG_SIGN, LTREE_GET_SIGLEN, PG_GETARG_POINTER, and PG_RETURN_POINTER.
Datum ltree_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 192 of file ltree_gist.c.
References cur, GETENTRY, hashing(), i, j, LOOPBYTE, LTG_ISALLTRUE, LTG_ISONENODE, LTG_LNODE, LTG_NODE, LTG_RNODE, LTG_SIGN, ltree_compare(), LTREE_GET_SIGLEN, ltree_gist_alloc(), GistEntryVector::n, palloc0(), PG_GETARG_POINTER, PG_RETURN_POINTER, size, and VARSIZE.
PG_FUNCTION_INFO_V1 | ( | ltree_compress | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_consistent | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_decompress | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_gist_in | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_gist_options | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_gist_out | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_penalty | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_picksplit | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_same | ) |
PG_FUNCTION_INFO_V1 | ( | ltree_union | ) |
|
static |
Definition at line 286 of file ltree_gist.c.
References a, b, and ltree_compare().
Referenced by ltree_picksplit().