PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/reloptions.h"
#include "access/stratnum.h"
#include "fmgr.h"
#include "port/pg_bitutils.h"
#include "trgm.h"
#include "varatt.h"
Go to the source code of this file.
Data Structures | |
struct | TrgmGistOptions |
struct | gtrgm_consistent_cache |
struct | CACHESIGN |
struct | SPLITCOST |
Macros | |
#define | GET_SIGLEN() |
#define | GETENTRY(vec, pos) ((TRGM *) DatumGetPointer((vec)->vector[(pos)].key)) |
#define | WISH_F(a, b, c) (double)( -(double)(((a)-(b))*((a)-(b))*((a)-(b)))*(c) ) |
#define GET_SIGLEN | ( | ) |
Definition at line 20 of file trgm_gist.c.
#define GETENTRY | ( | vec, | |
pos | |||
) | ((TRGM *) DatumGetPointer((vec)->vector[(pos)].key)) |
Definition at line 40 of file trgm_gist.c.
Definition at line 761 of file trgm_gist.c.
Definition at line 179 of file trgm_gist.c.
References ARRNELEM, CPTRGM, GETARR, GETBIT, HASHVAL, len, and sign.
Referenced by gtrgm_consistent(), and gtrgm_distance().
|
static |
Definition at line 769 of file trgm_gist.c.
Referenced by gtrgm_picksplit().
Definition at line 749 of file trgm_gist.c.
References CACHESIGN::allistrue, GETSIGN, ISALLTRUE, ISARRKEY, sort-test::key, makesign(), CACHESIGN::sign, and sign.
Referenced by gtrgm_picksplit().
Definition at line 77 of file trgm_gist.c.
References ALLISTRUE, CALCGTSIZE, flag(), GETSIGN, palloc(), res, SET_VARSIZE, sign, SIGNKEY, and size.
Referenced by gtrgm_compress(), gtrgm_picksplit(), and gtrgm_union().
Datum gtrgm_compress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 115 of file trgm_gist.c.
References DatumGetPointer(), DatumGetTextPP, generate_trgm(), GET_SIGLEN, GETSIGN, gistentryinit, gtrgm_alloc(), i, ISALLTRUE, ISSIGNKEY, GISTENTRY::key, GISTENTRY::leafkey, LOOPBYTE, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), GISTENTRY::rel, res, sign, val, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Datum gtrgm_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 197 of file trgm_gist.c.
References ARRNELEM, cnt_sml(), cnt_sml_sign_common(), CPTRGM, createTrgmNFA(), DatumGetPointer(), elog, EqualStrategyNumber, ERROR, generate_trgm(), generate_wildcard_trgm(), GET_SIGLEN, GETARR, GETBIT, GETSIGN, GIST_LEAF, gtrgm_consistent_cache::graph, HASHVAL, if(), ILikeStrategyNumber, index_strategy_get_limit(), ISALLTRUE, GISTENTRY::key, sort-test::key, len, LikeStrategyNumber, MAXALIGN, MemoryContextAlloc(), palloc(), pfree(), PG_GET_COLLATION, PG_GETARG_POINTER, PG_GETARG_TEXT_P, PG_GETARG_UINT16, PG_RETURN_BOOL, gtrgm_consistent_cache::query, RegExpICaseStrategyNumber, RegExpStrategyNumber, res, sign, SimilarityStrategyNumber, gtrgm_consistent_cache::strategy, StrictWordSimilarityStrategyNumber, trgm_contained_by(), trgm_presence_map(), gtrgm_consistent_cache::trigrams, trigramsMatchGraph(), VARDATA, VARHDRSZ, VARSIZE, and WordSimilarityStrategyNumber.
Datum gtrgm_decompress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 155 of file trgm_gist.c.
References DatumGetPointer(), DatumGetTextPP, gistentryinit, GISTENTRY::key, sort-test::key, GISTENTRY::leafkey, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), and GISTENTRY::rel.
Datum gtrgm_distance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 452 of file trgm_gist.c.
References ARRNELEM, cnt_sml(), cnt_sml_sign_common(), DatumGetPointer(), DistanceStrategyNumber, elog, ERROR, generate_trgm(), GET_SIGLEN, GETSIGN, GIST_LEAF, if(), ISALLTRUE, GISTENTRY::key, sort-test::key, len, MAXALIGN, MemoryContextAlloc(), pfree(), PG_GETARG_POINTER, PG_GETARG_TEXT_P, PG_GETARG_UINT16, PG_RETURN_FLOAT8, res, StrictWordDistanceStrategyNumber, VARDATA, VARHDRSZ, VARSIZE, and WordDistanceStrategyNumber.
Datum gtrgm_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 57 of file trgm_gist.c.
References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.
Datum gtrgm_options | ( | PG_FUNCTION_ARGS | ) |
Definition at line 960 of file trgm_gist.c.
References add_local_int_reloption(), init_local_reloptions(), PG_GETARG_POINTER, PG_RETURN_VOID, SIGLEN_DEFAULT, and SIGLEN_MAX.
Datum gtrgm_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 67 of file trgm_gist.c.
References ereport, errcode(), errmsg(), ERROR, and PG_RETURN_VOID.
Datum gtrgm_penalty | ( | PG_FUNCTION_ARGS | ) |
Definition at line 687 of file trgm_gist.c.
References DatumGetPointer(), GET_SIGLEN, GETSIGN, hemdist(), hemdistsign(), ISALLTRUE, ISARRKEY, GISTENTRY::key, makesign(), MAXALIGN, MemoryContextAlloc(), newval, pfree(), PG_GETARG_POINTER, PG_RETURN_POINTER, SIGLENBIT, sign, sizebitvec(), and VARSIZE.
Datum gtrgm_picksplit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 795 of file trgm_gist.c.
References comparecost(), SPLITCOST::cost, fillcache(), FirstOffsetNumber, GET_SIGLEN, GETENTRY, GETSIGN, gtrgm_alloc(), hemdistcache(), hemdistsign(), i, ISALLTRUE, j, LOOPBYTE, GistEntryVector::n, OffsetNumberNext, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), SPLITCOST::pos, qsort, SIGLENBIT, CACHESIGN::sign, sign, sizebitvec(), 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 gtrgm_same | ( | PG_FUNCTION_ARGS | ) |
Definition at line 590 of file trgm_gist.c.
References a, ARRNELEM, b, CMPTRGM, GET_SIGLEN, GETARR, GETSIGN, i, ISALLTRUE, ISSIGNKEY, LOOPBYTE, PG_GETARG_POINTER, and PG_RETURN_POINTER.
Datum gtrgm_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 564 of file trgm_gist.c.
References ALLISTRUE, CALCGTSIZE, TRGM::flag, GET_SIGLEN, GETENTRY, GETSIGN, gtrgm_alloc(), i, len, GistEntryVector::n, PG_GETARG_POINTER, PG_RETURN_POINTER, SET_VARSIZE, size, unionkey(), and VARSIZE.
Definition at line 671 of file trgm_gist.c.
References a, b, GETSIGN, hemdistsign(), ISALLTRUE, SIGLENBIT, and sizebitvec().
Referenced by gtrgm_penalty().
Definition at line 779 of file trgm_gist.c.
References a, b, hemdistsign(), SIGLENBIT, and sizebitvec().
Referenced by gtrgm_picksplit().
Definition at line 655 of file trgm_gist.c.
References a, b, i, LOOPBYTE, and pg_number_of_ones.
Referenced by gtrgm_penalty(), gtrgm_picksplit(), hemdist(), and hemdistcache().
Definition at line 98 of file trgm_gist.c.
References a, ARRNELEM, CPTRGM, GETARR, HASH, len, MemSet, SETBIT, SIGLENBIT, and sign.
Referenced by fillcache(), and gtrgm_penalty().
PG_FUNCTION_INFO_V1 | ( | gtrgm_compress | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_consistent | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_decompress | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_distance | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_in | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_options | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_out | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_penalty | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_picksplit | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_same | ) |
PG_FUNCTION_INFO_V1 | ( | gtrgm_union | ) |
Definition at line 649 of file trgm_gist.c.
References pg_popcount(), and sign.
Referenced by gtrgm_penalty(), gtrgm_picksplit(), hemdist(), and hemdistcache().