PostgreSQL Source Code
git master
|
#include "access/tupdesc.h"
#include "access/tupmacs.h"
#include "storage/bufpage.h"
#include "storage/itemptr.h"
Go to the source code of this file.
Data Structures | |
struct | IndexTupleData |
struct | IndexAttributeBitMapData |
Macros | |
#define | INDEX_SIZE_MASK 0x1FFF |
#define | INDEX_AM_RESERVED_BIT |
#define | INDEX_VAR_MASK 0x4000 |
#define | INDEX_NULL_MASK 0x8000 |
#define | IndexTupleSize(itup) ((Size) ((itup)->t_info & INDEX_SIZE_MASK)) |
#define | IndexTupleHasNulls(itup) ((((IndexTuple) (itup))->t_info & INDEX_NULL_MASK)) |
#define | IndexTupleHasVarwidths(itup) ((((IndexTuple) (itup))->t_info & INDEX_VAR_MASK)) |
#define | MaxIndexTuplesPerPage |
Typedefs | |
typedef struct IndexTupleData | IndexTupleData |
typedef IndexTupleData * | IndexTuple |
typedef struct IndexAttributeBitMapData | IndexAttributeBitMapData |
typedef IndexAttributeBitMapData * | IndexAttributeBitMap |
Functions | |
IndexTuple | index_form_tuple (TupleDesc tupleDescriptor, const Datum *values, const bool *isnull) |
IndexTuple | index_form_tuple_context (TupleDesc tupleDescriptor, const Datum *values, const bool *isnull, MemoryContext context) |
Datum | nocache_index_getattr (IndexTuple tup, int attnum, TupleDesc tupleDesc) |
void | index_deform_tuple (IndexTuple tup, TupleDesc tupleDescriptor, Datum *values, bool *isnull) |
void | index_deform_tuple_internal (TupleDesc tupleDescriptor, Datum *values, bool *isnull, char *tp, bits8 *bp, int hasnulls) |
IndexTuple | CopyIndexTuple (IndexTuple source) |
IndexTuple | index_truncate_tuple (TupleDesc sourceDescriptor, IndexTuple source, int leavenatts) |
static Size | IndexInfoFindDataOffset (unsigned short t_info) |
static Datum | index_getattr (IndexTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull) |
#define INDEX_AM_RESERVED_BIT |
#define IndexTupleHasNulls | ( | itup | ) | ((((IndexTuple) (itup))->t_info & INDEX_NULL_MASK)) |
#define IndexTupleHasVarwidths | ( | itup | ) | ((((IndexTuple) (itup))->t_info & INDEX_VAR_MASK)) |
#define IndexTupleSize | ( | itup | ) | ((Size) ((itup)->t_info & INDEX_SIZE_MASK)) |
#define MaxIndexTuplesPerPage |
typedef struct IndexAttributeBitMapData IndexAttributeBitMapData |
typedef IndexTupleData* IndexTuple |
typedef struct IndexTupleData IndexTupleData |
IndexTuple CopyIndexTuple | ( | IndexTuple | source | ) |
Definition at line 547 of file indextuple.c.
References IndexTupleSize, palloc(), size, and source.
Referenced by _bt_buildadd(), _bt_insert_parent(), _bt_insertonpg(), _bt_load(), _bt_newlevel(), _bt_pagedel(), _bt_swap_posting(), _hash_splitbucket(), _hash_squeezebucket(), btree_xlog_insert(), btree_xlog_split(), gistformdownlink(), and index_truncate_tuple().
void index_deform_tuple | ( | IndexTuple | tup, |
TupleDesc | tupleDescriptor, | ||
Datum * | values, | ||
bool * | isnull | ||
) |
Definition at line 456 of file indextuple.c.
References index_deform_tuple_internal(), IndexInfoFindDataOffset(), IndexTupleHasNulls, IndexTupleData::t_info, and values.
Referenced by _bt_check_unique(), comparetup_index_btree_tiebreak(), get_actual_variable_endpoint(), gist_page_items(), index_truncate_tuple(), and StoreIndexTuple().
void index_deform_tuple_internal | ( | TupleDesc | tupleDescriptor, |
Datum * | values, | ||
bool * | isnull, | ||
char * | tp, | ||
bits8 * | bp, | ||
int | hasnulls | ||
) |
Definition at line 479 of file indextuple.c.
References Assert, att_addlength_pointer, att_align_nominal, att_align_pointer, att_isnull(), attnum, fetchatt, INDEX_MAX_KEYS, TupleDescData::natts, TupleDescAttr, and values.
Referenced by index_deform_tuple(), and spgDeformLeafTuple().
IndexTuple index_form_tuple | ( | TupleDesc | tupleDescriptor, |
const Datum * | values, | ||
const bool * | isnull | ||
) |
Definition at line 44 of file indextuple.c.
References CurrentMemoryContext, index_form_tuple_context(), and values.
Referenced by bt_normalize_tuple(), bt_tuple_present_callback(), btinsert(), GinFormTuple(), gistFormTuple(), hashbuildCallback(), hashinsert(), and index_truncate_tuple().
IndexTuple index_form_tuple_context | ( | TupleDesc | tupleDescriptor, |
const Datum * | values, | ||
const bool * | isnull, | ||
MemoryContext | context | ||
) |
Definition at line 65 of file indextuple.c.
References Assert, context, DatumGetPointer(), detoast_external_attr(), ereport, errcode(), errmsg(), ERROR, heap_compute_data_size(), heap_fill_tuple(), HEAP_HASEXTERNAL, HEAP_HASVARWIDTH, i, INDEX_MAX_KEYS, INDEX_NULL_MASK, INDEX_SIZE_MASK, INDEX_VAR_MASK, IndexInfoFindDataOffset(), MAXALIGN, MemoryContextAllocZero(), TupleDescData::natts, pfree(), PointerGetDatum(), size, IndexTupleData::t_info, toast_compress_datum(), TOAST_INDEX_HACK, TOAST_INDEX_TARGET, TupleDescAttr, values, VARATT_IS_EXTENDED, VARATT_IS_EXTERNAL, and VARSIZE.
Referenced by index_form_tuple(), and tuplesort_putindextuplevalues().
|
inlinestatic |
Definition at line 117 of file itup.h.
References Assert, att_isnull(), attnum, fetchatt, IndexInfoFindDataOffset(), IndexTupleHasNulls, nocache_index_getattr(), PointerIsValid, IndexTupleData::t_info, and TupleDescAttr.
Referenced by _bt_advance_array_keys(), _bt_check_compare(), _bt_check_rowcompare(), _bt_compare(), _bt_keep_natts(), _bt_keep_natts_fast(), _bt_load(), _bt_mkscankey(), _bt_tuple_before_array_skeys(), _hash_checkqual(), bt_normalize_tuple(), comparetup_index_btree_tiebreak(), gintuple_get_attrnum(), gintuple_get_key(), gistchoose(), gistDeCompressAtt(), gistFetchTuple(), gistindex_keytest(), gistMakeUnionItVec(), gistSplitByKey(), readtup_index(), removeabbrev_index(), and tuplesort_putindextuplevalues().
IndexTuple index_truncate_tuple | ( | TupleDesc | sourceDescriptor, |
IndexTuple | source, | ||
int | leavenatts | ||
) |
Definition at line 576 of file indextuple.c.
References Assert, CopyIndexTuple(), index_deform_tuple(), index_form_tuple(), INDEX_MAX_KEYS, IndexTupleSize, TupleDescData::natts, palloc(), pfree(), source, IndexTupleData::t_tid, TupleDescCopy(), TupleDescSize, and values.
Referenced by _bt_truncate().
|
inlinestatic |
Definition at line 98 of file itup.h.
References INDEX_NULL_MASK, and MAXALIGN.
Referenced by _hash_get_indextuple_hashkey(), bt_page_print_tuples(), index_deform_tuple(), index_form_tuple_context(), index_getattr(), and nocache_index_getattr().
Datum nocache_index_getattr | ( | IndexTuple | tup, |
int | attnum, | ||
TupleDesc | tupleDesc | ||
) |
Definition at line 241 of file indextuple.c.
References Assert, att_addlength_pointer, att_align_nominal, att_align_pointer, att_isnull(), attlen, attnum, fetchatt, i, IndexInfoFindDataOffset(), IndexTupleHasNulls, IndexTupleHasVarwidths, j, TupleDescData::natts, IndexTupleData::t_info, and TupleDescAttr.
Referenced by index_getattr().