PostgreSQL Source Code git master
|
#include "postgres.h"
#include <math.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 28 of file _ltree_gist.c.
Definition at line 29 of file _ltree_gist.c.
Definition at line 31 of file _ltree_gist.c.
typedef struct LtreeSignature LtreeSignature |
|
static |
Definition at line 481 of file _ltree_gist.c.
References ARR_DATA_PTR, ARR_DIMS, ARR_NDIM, array_contains_nulls(), ArrayGetNItems(), ereport, errcode(), errmsg(), ERROR, gist_qe(), sort-test::key, and NEXTVAL.
Referenced by _ltree_consistent().
Datum _ltree_compress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 51 of file _ltree_gist.c.
References ALOOPBYTE, ARR_DATA_PTR, ARR_DIMS, ARR_NDIM, array_contains_nulls(), ArrayGetNItems(), DatumGetArrayTypeP, DatumGetPointer(), ereport, errcode(), errmsg(), ERROR, gistentryinit, hashing(), i, GISTENTRY::key, sort-test::key, GISTENTRY::leafkey, LTG_ISALLTRUE, LTG_SIGN, LTREE_GET_ASIGLEN, ltree_gist_alloc(), NEXTVAL, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), GISTENTRY::rel, sign, and val.
Datum _ltree_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 506 of file _ltree_gist.c.
References _arrq_cons(), DatumGetPointer(), elog, ERROR, gist_qe(), gist_qtxt(), gist_te(), GISTENTRY::key, sort-test::key, LTREE_GET_ASIGLEN, PG_DETOAST_DATUM, PG_FREE_IF_COPY, PG_GETARG_DATUM, PG_GETARG_POINTER, PG_GETARG_UINT16, PG_RETURN_BOOL, and res.
Datum _ltree_gist_options | ( | PG_FUNCTION_ARGS | ) |
Definition at line 548 of file _ltree_gist.c.
References add_local_int_reloption(), 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 220 of file _ltree_gist.c.
References DatumGetPointer(), hemdist(), sort-test::key, LTREE_GET_ASIGLEN, newval, PG_GETARG_POINTER, and PG_RETURN_POINTER.
Datum _ltree_picksplit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 244 of file _ltree_gist.c.
References ALOOPBYTE, comparecost(), SPLITCOST::cost, FirstOffsetNumber, GETENTRY, hemdist(), i, j, LTG_ISALLTRUE, LTG_SIGN, LTREE_GET_ASIGLEN, ltree_gist_alloc(), GistEntryVector::n, OffsetNumberNext, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), SPLITCOST::pos, 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 109 of file _ltree_gist.c.
References a, ALOOPBYTE, b, i, LTG_ISALLTRUE, LTG_SIGN, LTREE_GET_ASIGLEN, PG_GETARG_POINTER, and PG_RETURN_POINTER.
Datum _ltree_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 156 of file _ltree_gist.c.
References ltree_gist::flag, GETENTRY, i, LTG_ALLTRUE, LTG_HDRSIZE, LTG_SIGN, LTREE_GET_ASIGLEN, ltree_gist_alloc(), GistEntryVector::n, PG_GETARG_POINTER, PG_RETURN_POINTER, SET_VARSIZE, size, unionkey(), and VARSIZE.
|
static |
Definition at line 418 of file _ltree_gist.c.
References AHASHVAL, FLG_CANLOOKSIGN, GETBIT, sig, and val.
Referenced by gist_qtxt().
|
static |
Definition at line 238 of file _ltree_gist.c.
Referenced by _ltree_picksplit().
|
static |
Definition at line 442 of file _ltree_gist.c.
References AHASHVAL, GETBIT, 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 426 of file _ltree_gist.c.
References checkcondition_bit(), GETQUERY, sort-test::key, LTG_ISALLTRUE, LTG_SIGN, ltree_execute(), and sig.
Referenced by _ltree_consistent().
|
static |
Definition at line 389 of file _ltree_gist.c.
References AHASHVAL, GETBIT, sort-test::key, ltree_level::len, LEVEL_NEXT, LTG_ISALLTRUE, LTG_SIGN, ltree_crc32_sz(), LTREE_FIRST, ltree_level::name, ltree::numlevel, and sign.
Referenced by _ltree_consistent().
Definition at line 35 of file _ltree_gist.c.
References AHASH, cur, hash(), LEVEL_NEXT, ltree_crc32_sz(), LTREE_FIRST, cursor::name, ltree::numlevel, and sign.
Referenced by _ltree_compress().
|
static |
Definition at line 203 of file _ltree_gist.c.
References a, ASIGLENBIT, b, hemdistsign(), LTG_ISALLTRUE, LTG_SIGN, and sizebitvec().
Referenced by _ltree_penalty(), and _ltree_picksplit().
Definition at line 187 of file _ltree_gist.c.
References a, ALOOPBYTE, b, i, and pg_number_of_ones.
Referenced by hemdist().
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 181 of file _ltree_gist.c.
References pg_popcount(), and sign.
Referenced by hemdist().
|
static |
Definition at line 142 of file _ltree_gist.c.
References ALOOPBYTE, i, LTG_ISALLTRUE, and LTG_SIGN.
Referenced by _ltree_union().