PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
btree_utils_var.h
Go to the documentation of this file.
1/*
2 * contrib/btree_gist/btree_utils_var.h
3 */
4#ifndef __BTREE_UTILS_VAR_H__
5#define __BTREE_UTILS_VAR_H__
6
7#include "access/gist.h"
8#include "btree_gist.h"
9
10/* Variable length key */
12
13/* Better readable key */
14typedef struct
15{
19
20/*
21 * type description
22 */
23typedef struct
24{
25
26 /* Attribs */
27
28 enum gbtree_type t; /* data type */
29 int32 eml; /* cached pg_database_encoding_max_length (0:
30 * undefined) */
31 bool trnc; /* truncate (=compress) key */
32
33 /* Methods */
34
35 bool (*f_gt) (const void *, const void *, Oid, FmgrInfo *); /* greater than */
36 bool (*f_ge) (const void *, const void *, Oid, FmgrInfo *); /* greater equal */
37 bool (*f_eq) (const void *, const void *, Oid, FmgrInfo *); /* equal */
38 bool (*f_le) (const void *, const void *, Oid, FmgrInfo *); /* less equal */
39 bool (*f_lt) (const void *, const void *, Oid, FmgrInfo *); /* less than */
40 int32 (*f_cmp) (const void *, const void *, Oid, FmgrInfo *); /* compare */
41 GBT_VARKEY *(*f_l2n) (GBT_VARKEY *, FmgrInfo *flinfo); /* convert leaf to node */
43
44
45
47
49
51
52extern GBT_VARKEY *gbt_var_union(const GistEntryVector *entryvec, int32 *size,
53 Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
54
55extern bool gbt_var_same(Datum d1, Datum d2, Oid collation,
56 const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
57
58extern float *gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
59 Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
60
61extern bool gbt_var_consistent(GBT_VARKEY_R *key, const void *query,
62 StrategyNumber strategy, Oid collation, bool is_leaf,
63 const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
64
66 Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
67
68extern void gbt_var_bin_union(Datum *u, GBT_VARKEY *e, Oid collation,
69 const gbtree_vinfo *tinfo, FmgrInfo *flinfo);
70
71#endif
static const gbtree_vinfo tinfo
Definition: btree_bit.c:108
gbtree_type
Definition: btree_gist.h:15
GBT_VARKEY * gbt_var_union(const GistEntryVector *entryvec, int32 *size, Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)
bool gbt_var_consistent(GBT_VARKEY_R *key, const void *query, StrategyNumber strategy, Oid collation, bool is_leaf, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)
GISTENTRY * gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo)
GIST_SPLITVEC * gbt_var_picksplit(const GistEntryVector *entryvec, GIST_SPLITVEC *v, Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)
GBT_VARKEY_R gbt_var_key_readable(const GBT_VARKEY *k)
float * gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n, Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)
GBT_VARKEY * gbt_var_key_copy(const GBT_VARKEY_R *u)
bool gbt_var_same(Datum d1, Datum d2, Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)
void gbt_var_bin_union(Datum *u, GBT_VARKEY *e, Oid collation, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)
bytea GBT_VARKEY
int32_t int32
Definition: c.h:481
uintptr_t Datum
Definition: postgres.h:64
unsigned int Oid
Definition: postgres_ext.h:31
e
Definition: preproc-init.c:82
static pg_noinline void Size size
Definition: slab.c:607
uint16 StrategyNumber
Definition: stratnum.h:22
Definition: fmgr.h:57
enum gbtree_type t
Definition: c.h:641