PostgreSQL Source Code git master
Loading...
Searching...
No Matches
skipsupport.h File Reference
#include "utils/relcache.h"
Include dependency graph for skipsupport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SkipSupportData
 

Typedefs

typedef struct SkipSupportDataSkipSupport
 
typedef Datum(* SkipSupportIncDec) (Relation rel, Datum existing, bool *overflow)
 
typedef struct SkipSupportData SkipSupportData
 

Functions

SkipSupport PrepareSkipSupportFromOpclass (Oid opfamily, Oid opcintype, bool reverse)
 

Typedef Documentation

◆ SkipSupport

Definition at line 50 of file skipsupport.h.

◆ SkipSupportData

◆ SkipSupportIncDec

typedef Datum(* SkipSupportIncDec) (Relation rel, Datum existing, bool *overflow)

Definition at line 51 of file skipsupport.h.

Function Documentation

◆ PrepareSkipSupportFromOpclass()

SkipSupport PrepareSkipSupportFromOpclass ( Oid  opfamily,
Oid  opcintype,
bool  reverse 
)
extern

Definition at line 30 of file skipsupport.c.

31{
33 SkipSupport sksup;
34
35 /* Look for a skip support function */
36 skipSupportFunction = get_opfamily_proc(opfamily, opcintype, opcintype,
39 return NULL;
40
43
44 if (reverse)
45 {
46 /*
47 * DESC/reverse case: swap low_elem with high_elem, and swap decrement
48 * with increment
49 */
50 Datum low_elem = sksup->low_elem;
51 SkipSupportIncDec decrement = sksup->decrement;
52
53 sksup->low_elem = sksup->high_elem;
54 sksup->decrement = sksup->increment;
55
56 sksup->high_elem = low_elem;
57 sksup->increment = decrement;
58 }
59
60 return sksup;
61}
#define OidIsValid(objectId)
Definition c.h:788
#define palloc_object(type)
Definition fe_memutils.h:74
#define OidFunctionCall1(functionId, arg1)
Definition fmgr.h:722
Oid get_opfamily_proc(Oid opfamily, Oid lefttype, Oid righttype, int16 procnum)
Definition lsyscache.c:872
#define BTSKIPSUPPORT_PROC
Definition nbtree.h:722
static Datum PointerGetDatum(const void *X)
Definition postgres.h:352
uint64_t Datum
Definition postgres.h:70
unsigned int Oid
static int fb(int x)
Datum(* SkipSupportIncDec)(Relation rel, Datum existing, bool *overflow)
Definition skipsupport.h:51
SkipSupportIncDec decrement
Definition skipsupport.h:91
SkipSupportIncDec increment
Definition skipsupport.h:92

References BTSKIPSUPPORT_PROC, SkipSupportData::decrement, fb(), get_opfamily_proc(), SkipSupportData::high_elem, SkipSupportData::increment, SkipSupportData::low_elem, OidFunctionCall1, OidIsValid, palloc_object, and PointerGetDatum().

Referenced by _bt_preprocess_array_keys().