PostgreSQL Source Code
git master
|
#include "access/amapi.h"
#include "access/itup.h"
#include "access/sdir.h"
#include "access/tableam.h"
#include "access/xlogreader.h"
#include "catalog/pg_am_d.h"
#include "catalog/pg_index.h"
#include "lib/stringinfo.h"
#include "storage/bufmgr.h"
#include "storage/shm_toc.h"
Go to the source code of this file.
Data Structures | |
struct | BTPageOpaqueData |
struct | BTMetaPageData |
struct | BTStackData |
struct | BTScanInsertData |
struct | BTInsertStateData |
struct | BTDedupInterval |
struct | BTDedupStateData |
struct | BTVacuumPostingData |
struct | BTScanPosItem |
struct | BTScanPosData |
struct | BTArrayKeyInfo |
struct | BTScanOpaqueData |
struct | BTOptions |
Macros | |
#define | BTP_LEAF (1 << 0) /* leaf page, i.e. not internal page */ |
#define | BTP_ROOT (1 << 1) /* root page (has no parent) */ |
#define | BTP_DELETED (1 << 2) /* page has been deleted from tree */ |
#define | BTP_META (1 << 3) /* meta-page */ |
#define | BTP_HALF_DEAD (1 << 4) /* empty, but still in tree */ |
#define | BTP_SPLIT_END (1 << 5) /* rightmost page of split group */ |
#define | BTP_HAS_GARBAGE (1 << 6) /* page has LP_DEAD tuples (deprecated) */ |
#define | BTP_INCOMPLETE_SPLIT (1 << 7) /* right sibling's downlink is missing */ |
#define | MAX_BT_CYCLE_ID 0xFF7F |
#define | BTPageGetMeta(p) ((BTMetaPageData *) PageGetContents(p)) |
#define | BTREE_METAPAGE 0 /* first page is meta */ |
#define | BTREE_MAGIC 0x053162 /* magic number in metapage */ |
#define | BTREE_VERSION 4 /* current version number */ |
#define | BTREE_MIN_VERSION 2 /* minimum supported version */ |
#define | BTREE_NOVAC_VERSION 3 /* version with all meta fields set */ |
#define | BTMaxItemSize(page) |
#define | BTMaxItemSizeNoHeapTid(page) |
#define | MaxTIDsPerBTreePage |
#define | BTREE_MIN_FILLFACTOR 10 |
#define | BTREE_DEFAULT_FILLFACTOR 90 |
#define | BTREE_NONLEAF_FILLFACTOR 70 |
#define | BTREE_SINGLEVAL_FILLFACTOR 96 |
#define | P_NONE 0 |
#define | P_LEFTMOST(opaque) ((opaque)->btpo_prev == P_NONE) |
#define | P_RIGHTMOST(opaque) ((opaque)->btpo_next == P_NONE) |
#define | P_ISLEAF(opaque) (((opaque)->btpo_flags & BTP_LEAF) != 0) |
#define | P_ISROOT(opaque) (((opaque)->btpo_flags & BTP_ROOT) != 0) |
#define | P_ISDELETED(opaque) (((opaque)->btpo_flags & BTP_DELETED) != 0) |
#define | P_ISMETA(opaque) (((opaque)->btpo_flags & BTP_META) != 0) |
#define | P_ISHALFDEAD(opaque) (((opaque)->btpo_flags & BTP_HALF_DEAD) != 0) |
#define | P_IGNORE(opaque) (((opaque)->btpo_flags & (BTP_DELETED|BTP_HALF_DEAD)) != 0) |
#define | P_HAS_GARBAGE(opaque) (((opaque)->btpo_flags & BTP_HAS_GARBAGE) != 0) |
#define | P_INCOMPLETE_SPLIT(opaque) (((opaque)->btpo_flags & BTP_INCOMPLETE_SPLIT) != 0) |
#define | P_HIKEY ((OffsetNumber) 1) |
#define | P_FIRSTKEY ((OffsetNumber) 2) |
#define | P_FIRSTDATAKEY(opaque) (P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY) |
#define | INDEX_ALT_TID_MASK INDEX_AM_RESERVED_BIT |
#define | BT_OFFSET_MASK 0x0FFF |
#define | BT_STATUS_OFFSET_MASK 0xF000 |
#define | BT_PIVOT_HEAP_TID_ATTR 0x1000 |
#define | BT_IS_POSTING 0x2000 |
#define | BTreeTupleGetNAtts(itup, rel) |
#define | BTCommuteStrategyNumber(strat) (BTMaxStrategyNumber + 1 - (strat)) |
#define | BTORDER_PROC 1 |
#define | BTSORTSUPPORT_PROC 2 |
#define | BTINRANGE_PROC 3 |
#define | BTEQUALIMAGE_PROC 4 |
#define | BTOPTIONS_PROC 5 |
#define | BTNProcs 5 |
#define | BT_READ BUFFER_LOCK_SHARE |
#define | BT_WRITE BUFFER_LOCK_EXCLUSIVE |
#define | BTScanPosIsPinned(scanpos) |
#define | BTScanPosUnpin(scanpos) |
#define | BTScanPosUnpinIfPinned(scanpos) |
#define | BTScanPosIsValid(scanpos) |
#define | BTScanPosInvalidate(scanpos) |
#define | SK_BT_REQFWD 0x00010000 /* required to continue forward scan */ |
#define | SK_BT_REQBKWD 0x00020000 /* required to continue backward scan */ |
#define | SK_BT_INDOPTION_SHIFT 24 /* must clear the above bits */ |
#define | SK_BT_DESC (INDOPTION_DESC << SK_BT_INDOPTION_SHIFT) |
#define | SK_BT_NULLS_FIRST (INDOPTION_NULLS_FIRST << SK_BT_INDOPTION_SHIFT) |
#define | BTGetFillFactor(relation) |
#define | BTGetTargetPageFreeSpace(relation) (BLCKSZ * (100 - BTGetFillFactor(relation)) / 100) |
#define | BTGetDeduplicateItems(relation) |
#define | PROGRESS_BTREE_PHASE_INDEXBUILD_TABLESCAN 2 |
#define | PROGRESS_BTREE_PHASE_PERFORMSORT_1 3 |
#define | PROGRESS_BTREE_PHASE_PERFORMSORT_2 4 |
#define | PROGRESS_BTREE_PHASE_LEAF_LOAD 5 |
Typedefs | |
typedef uint16 | BTCycleId |
typedef struct BTPageOpaqueData | BTPageOpaqueData |
typedef BTPageOpaqueData * | BTPageOpaque |
typedef struct BTMetaPageData | BTMetaPageData |
typedef struct BTStackData | BTStackData |
typedef BTStackData * | BTStack |
typedef struct BTScanInsertData | BTScanInsertData |
typedef BTScanInsertData * | BTScanInsert |
typedef struct BTInsertStateData | BTInsertStateData |
typedef BTInsertStateData * | BTInsertState |
typedef struct BTDedupInterval | BTDedupInterval |
typedef struct BTDedupStateData | BTDedupStateData |
typedef BTDedupStateData * | BTDedupState |
typedef struct BTVacuumPostingData | BTVacuumPostingData |
typedef BTVacuumPostingData * | BTVacuumPosting |
typedef struct BTScanPosItem | BTScanPosItem |
typedef struct BTScanPosData | BTScanPosData |
typedef BTScanPosData * | BTScanPos |
typedef struct BTArrayKeyInfo | BTArrayKeyInfo |
typedef struct BTScanOpaqueData | BTScanOpaqueData |
typedef BTScanOpaqueData * | BTScanOpaque |
typedef struct BTOptions | BTOptions |
#define BT_IS_POSTING 0x2000 |
Definition at line 342 of file nbtree.h.
Referenced by BTreeTupleIsPivot(), BTreeTupleIsPosting(), and BTreeTupleSetPosting().
#define BT_OFFSET_MASK 0x0FFF |
Definition at line 338 of file nbtree.h.
Referenced by _bt_check_natts(), and BTreeTupleGetNPosting().
#define BT_PIVOT_HEAP_TID_ATTR 0x1000 |
Definition at line 341 of file nbtree.h.
Referenced by _bt_check_natts(), BTreeTupleGetHeapTID(), and BTreeTupleSetNAtts().
#define BT_READ BUFFER_LOCK_SHARE |
Definition at line 588 of file nbtree.h.
Referenced by _bt_check_unique(), _bt_first(), _bt_get_endpoint(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_killitems(), _bt_leftsib_splitflag(), _bt_metaversion(), _bt_moveright(), _bt_pagedel(), _bt_readnextpage(), _bt_rightsib_halfdeadflag(), _bt_search(), _bt_unlink_halfdead_page(), _bt_update_meta_cleanup_info(), _bt_vacuum_needs_cleanup(), _bt_walk_left(), bt_recheck_sibling_links(), bt_rootdescend(), btvacuumpage(), palloc_btree_page(), and pgstat_btree_page().
#define BT_STATUS_OFFSET_MASK 0xF000 |
Definition at line 339 of file nbtree.h.
Referenced by BTreeTupleSetNAtts(), and BTreeTupleSetPosting().
#define BT_WRITE BUFFER_LOCK_EXCLUSIVE |
Definition at line 589 of file nbtree.h.
Referenced by _bt_finish_split(), _bt_getbuf(), _bt_getroot(), _bt_getstackbuf(), _bt_insertonpg(), _bt_moveright(), _bt_newroot(), _bt_pagedel(), _bt_search(), _bt_search_insert(), _bt_split(), _bt_stepright(), _bt_unlink_halfdead_page(), and _bt_update_meta_cleanup_info().
#define BTCommuteStrategyNumber | ( | strat | ) | (BTMaxStrategyNumber + 1 - (strat)) |
Definition at line 554 of file nbtree.h.
Referenced by _bt_compare_scankey_args(), and _bt_fix_scankey_strategy().
#define BTEQUALIMAGE_PROC 4 |
Definition at line 579 of file nbtree.h.
Referenced by _bt_allequalimage(), assignProcTypes(), and btvalidate().
#define BTGetDeduplicateItems | ( | relation | ) |
Definition at line 978 of file nbtree.h.
Referenced by _bt_delete_or_dedup_one_page(), and _bt_load().
#define BTGetFillFactor | ( | relation | ) |
Definition at line 970 of file nbtree.h.
Referenced by _bt_findsplitloc().
#define BTGetTargetPageFreeSpace | ( | relation | ) | (BLCKSZ * (100 - BTGetFillFactor(relation)) / 100) |
Definition at line 976 of file nbtree.h.
Referenced by _bt_pagestate().
#define BTINRANGE_PROC 3 |
Definition at line 578 of file nbtree.h.
Referenced by assignProcTypes(), btvalidate(), and transformFrameOffset().
#define BTMaxItemSize | ( | page | ) |
Definition at line 158 of file nbtree.h.
Referenced by _bt_buildadd(), _bt_check_third_page(), _bt_dedup_pass(), _bt_findinsertloc(), _bt_load(), bt_target_page_check(), and btree_xlog_dedup().
#define BTMaxItemSizeNoHeapTid | ( | page | ) |
Definition at line 164 of file nbtree.h.
Referenced by _bt_check_third_page(), and bt_target_page_check().
#define BTNProcs 5 |
Definition at line 581 of file nbtree.h.
Referenced by bthandler().
#define BTOPTIONS_PROC 5 |
Definition at line 580 of file nbtree.h.
Referenced by bthandler(), and btvalidate().
#define BTORDER_PROC 1 |
Definition at line 576 of file nbtree.h.
Referenced by _bt_first(), _bt_mkscankey(), _bt_sort_array_elements(), assignProcTypes(), btadjustmembers(), btvalidate(), ExecIndexBuildScanKeys(), ExecInitExprRec(), FinishSortSupportFunction(), load_rangetype_info(), lookup_type_cache(), match_clause_to_partition_key(), MJExamineQuals(), and RelationBuildPartitionKey().
#define BTP_DELETED (1 << 2) /* page has been deleted from tree */ |
Definition at line 75 of file nbtree.h.
Referenced by _bt_unlink_halfdead_page(), and btree_xlog_unlink_page().
#define BTP_HALF_DEAD (1 << 4) /* empty, but still in tree */ |
Definition at line 77 of file nbtree.h.
Referenced by _bt_mark_page_halfdead(), _bt_unlink_halfdead_page(), btree_xlog_mark_page_halfdead(), and btree_xlog_unlink_page().
#define BTP_HAS_GARBAGE (1 << 6) /* page has LP_DEAD tuples (deprecated) */ |
Definition at line 79 of file nbtree.h.
Referenced by _bt_check_unique(), _bt_dedup_pass(), _bt_delitems_delete(), _bt_delitems_vacuum(), _bt_killitems(), _bt_split(), btree_mask(), btree_xlog_dedup(), btree_xlog_delete(), and btree_xlog_vacuum().
#define BTP_INCOMPLETE_SPLIT (1 << 7) /* right sibling's downlink is missing */ |
Definition at line 80 of file nbtree.h.
Referenced by _bt_clear_incomplete_split(), _bt_insertonpg(), _bt_newroot(), _bt_split(), and btree_xlog_split().
#define BTP_LEAF (1 << 0) /* leaf page, i.e. not internal page */ |
Definition at line 73 of file nbtree.h.
Referenced by _bt_blnewpage(), _bt_getroot(), btree_xlog_mark_page_halfdead(), btree_xlog_newroot(), btree_xlog_split(), and btree_xlog_unlink_page().
#define BTP_META (1 << 3) /* meta-page */ |
Definition at line 76 of file nbtree.h.
Referenced by _bt_initmetapage(), _bt_restore_meta(), and _bt_upgrademetapage().
#define BTP_ROOT (1 << 1) /* root page (has no parent) */ |
Definition at line 74 of file nbtree.h.
Referenced by _bt_getroot(), _bt_newroot(), _bt_split(), _bt_uppershutdown(), and btree_xlog_newroot().
#define BTP_SPLIT_END (1 << 5) /* rightmost page of split group */ |
Definition at line 78 of file nbtree.h.
Referenced by _bt_split(), btree_mask(), and btvacuumpage().
#define BTPageGetMeta | ( | p | ) | ((BTMetaPageData *) PageGetContents(p)) |
Definition at line 115 of file nbtree.h.
Referenced by _bt_finish_split(), _bt_getmeta(), _bt_gettrueroot(), _bt_initmetapage(), _bt_insertonpg(), _bt_newroot(), _bt_restore_meta(), _bt_unlink_halfdead_page(), _bt_update_meta_cleanup_info(), _bt_upgrademetapage(), _bt_vacuum_needs_cleanup(), bt_check_every_level(), bt_metap(), palloc_btree_page(), and pgstatindex_impl().
#define BTREE_MAGIC 0x053162 /* magic number in metapage */ |
Definition at line 143 of file nbtree.h.
Referenced by _bt_getmeta(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_initmetapage(), _bt_metaversion(), _bt_restore_meta(), and palloc_btree_page().
#define BTREE_METAPAGE 0 /* first page is meta */ |
Definition at line 142 of file nbtree.h.
Referenced by _bt_finish_split(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_insertonpg(), _bt_leafbuild(), _bt_metaversion(), _bt_newroot(), _bt_restore_meta(), _bt_unlink_halfdead_page(), _bt_update_meta_cleanup_info(), _bt_uppershutdown(), _bt_vacuum_needs_cleanup(), bt_check_every_level(), btbuildempty(), btvacuumscan(), palloc_btree_page(), and pgstat_relation().
#define BTREE_MIN_VERSION 2 /* minimum supported version */ |
Definition at line 145 of file nbtree.h.
Referenced by _bt_getmeta(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_metaversion(), _bt_upgrademetapage(), and palloc_btree_page().
#define BTREE_NONLEAF_FILLFACTOR 70 |
Definition at line 196 of file nbtree.h.
Referenced by _bt_findsplitloc(), and _bt_pagestate().
#define BTREE_NOVAC_VERSION 3 /* version with all meta fields set */ |
Definition at line 146 of file nbtree.h.
Referenced by _bt_check_third_page(), _bt_getroot(), _bt_getrootheight(), _bt_insertonpg(), _bt_metaversion(), _bt_newroot(), _bt_restore_meta(), _bt_unlink_halfdead_page(), _bt_update_meta_cleanup_info(), _bt_upgrademetapage(), _bt_vacuum_needs_cleanup(), and bt_metap().
#define BTREE_SINGLEVAL_FILLFACTOR 96 |
Definition at line 197 of file nbtree.h.
Referenced by _bt_findsplitloc(), and _bt_singleval_fillfactor().
#define BTREE_VERSION 4 /* current version number */ |
Definition at line 144 of file nbtree.h.
Referenced by _bt_check_third_page(), _bt_getmeta(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_initmetapage(), _bt_metaversion(), and palloc_btree_page().
#define BTreeTupleGetNAtts | ( | itup, | |
rel | |||
) |
Definition at line 446 of file nbtree.h.
Referenced by _bt_buildadd(), _bt_check_natts(), _bt_checkkeys(), _bt_compare(), _bt_insertonpg(), _bt_mkscankey(), _bt_newroot(), _bt_readpage(), _bt_split(), _bt_uppershutdown(), and bt_target_page_check().
#define BTScanPosInvalidate | ( | scanpos | ) |
Definition at line 887 of file nbtree.h.
Referenced by _bt_endpoint(), _bt_first(), _bt_readnextpage(), _bt_steppage(), btbeginscan(), btmarkpos(), btrescan(), and btrestrpos().
#define BTScanPosIsPinned | ( | scanpos | ) |
Definition at line 864 of file nbtree.h.
Referenced by _bt_killitems(), _bt_readnextpage(), _bt_readpage(), _bt_steppage(), and btrestrpos().
#define BTScanPosIsValid | ( | scanpos | ) |
Definition at line 881 of file nbtree.h.
Referenced by _bt_first(), _bt_killitems(), _bt_steppage(), btendscan(), btgettuple(), btmarkpos(), btrescan(), and btrestrpos().
#define BTScanPosUnpin | ( | scanpos | ) |
#define BTScanPosUnpinIfPinned | ( | scanpos | ) |
Definition at line 875 of file nbtree.h.
Referenced by _bt_readnextpage(), _bt_steppage(), btendscan(), btmarkpos(), btrescan(), and btrestrpos().
#define BTSORTSUPPORT_PROC 2 |
Definition at line 577 of file nbtree.h.
Referenced by assignProcTypes(), btvalidate(), FinishSortSupportFunction(), and MJExamineQuals().
#define INDEX_ALT_TID_MASK INDEX_AM_RESERVED_BIT |
Definition at line 335 of file nbtree.h.
Referenced by _bt_form_posting(), _bt_update_posting(), BTreeTupleIsPivot(), BTreeTupleIsPosting(), BTreeTupleSetNAtts(), and BTreeTupleSetPosting().
#define MAX_BT_CYCLE_ID 0xFF7F |
Definition at line 89 of file nbtree.h.
Referenced by _bt_start_vacuum().
#define MaxTIDsPerBTreePage |
Definition at line 180 of file nbtree.h.
Referenced by _bt_bottomupdel_pass(), _bt_readpage(), _bt_simpledel_pass(), bt_check_every_level(), and btgettuple().
#define P_FIRSTDATAKEY | ( | opaque | ) | (P_RIGHTMOST(opaque) ? P_HIKEY : P_FIRSTKEY) |
Definition at line 245 of file nbtree.h.
Referenced by _bt_binsrch(), _bt_binsrch_insert(), _bt_bottomupdel_pass(), _bt_check_natts(), _bt_check_unique(), _bt_compare(), _bt_dedup_pass(), _bt_delete_or_dedup_one_page(), _bt_endpoint(), _bt_findsplitloc(), _bt_get_endpoint(), _bt_getstackbuf(), _bt_insertonpg(), _bt_killitems(), _bt_lock_subtree_parent(), _bt_mark_page_halfdead(), _bt_pagedel(), _bt_readnextpage(), _bt_readpage(), _bt_split(), _bt_unlink_halfdead_page(), bt_check_level_from_leftmost(), bt_child_check(), bt_downlink_missing_check(), bt_right_page_check_scankey(), bt_target_page_check(), btree_xlog_dedup(), btree_xlog_split(), btvacuumpage(), invariant_l_nontarget_offset(), invariant_l_offset(), offset_is_negative_infinity(), palloc_btree_page(), and pgstat_btree_page().
#define P_FIRSTKEY ((OffsetNumber) 2) |
Definition at line 244 of file nbtree.h.
Referenced by _bt_afternewitemoff(), _bt_buildadd(), _bt_newroot(), and _bt_slideleft().
#define P_HAS_GARBAGE | ( | opaque | ) | (((opaque)->btpo_flags & BTP_HAS_GARBAGE) != 0) |
Definition at line 221 of file nbtree.h.
Referenced by _bt_dedup_pass(), _bt_findinsertloc(), btree_xlog_dedup(), and palloc_btree_page().
#define P_HIKEY ((OffsetNumber) 1) |
Definition at line 243 of file nbtree.h.
Referenced by _bt_buildadd(), _bt_check_natts(), _bt_check_unique(), _bt_dedup_pass(), _bt_findinsertloc(), _bt_findsplitloc(), _bt_insert_parent(), _bt_mark_page_halfdead(), _bt_moveright(), _bt_newroot(), _bt_pagedel(), _bt_pagestate(), _bt_readpage(), _bt_search_insert(), _bt_slideleft(), _bt_split(), _bt_strategy(), _bt_unlink_halfdead_page(), bt_check_level_from_leftmost(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_page_print_tuples(), bt_target_page_check(), btree_xlog_dedup(), btree_xlog_mark_page_halfdead(), btree_xlog_split(), btree_xlog_unlink_page(), and palloc_btree_page().
#define P_IGNORE | ( | opaque | ) | (((opaque)->btpo_flags & (BTP_DELETED|BTP_HALF_DEAD)) != 0) |
Definition at line 220 of file nbtree.h.
Referenced by _bt_check_natts(), _bt_check_unique(), _bt_get_endpoint(), _bt_getroot(), _bt_getstackbuf(), _bt_gettrueroot(), _bt_mark_page_halfdead(), _bt_moveright(), _bt_pagedel(), _bt_readnextpage(), _bt_search_insert(), _bt_stepright(), bt_check_level_from_leftmost(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_right_page_check_scankey(), bt_target_page_check(), GetBTPageStatistics(), pgstat_btree_page(), and pgstatindex_impl().
#define P_INCOMPLETE_SPLIT | ( | opaque | ) | (((opaque)->btpo_flags & BTP_INCOMPLETE_SPLIT) != 0) |
Definition at line 222 of file nbtree.h.
Referenced by _bt_clear_incomplete_split(), _bt_findinsertloc(), _bt_finish_split(), _bt_getstackbuf(), _bt_insertonpg(), _bt_leftsib_splitflag(), _bt_lock_subtree_parent(), _bt_moveright(), _bt_newroot(), _bt_pagedel(), _bt_stepright(), and bt_child_highkey_check().
#define P_ISDELETED | ( | opaque | ) | (((opaque)->btpo_flags & BTP_DELETED) != 0) |
Definition at line 217 of file nbtree.h.
Referenced by _bt_page_recyclable(), _bt_pagedel(), _bt_rightsib_halfdeadflag(), _bt_unlink_halfdead_page(), _bt_walk_left(), bt_check_level_from_leftmost(), bt_child_check(), bt_downlink_missing_check(), bt_page_items_bytea(), bt_page_items_internal(), bt_recheck_sibling_links(), btvacuumpage(), GetBTPageStatistics(), palloc_btree_page(), and pgstatindex_impl().
#define P_ISHALFDEAD | ( | opaque | ) | (((opaque)->btpo_flags & BTP_HALF_DEAD) != 0) |
Definition at line 219 of file nbtree.h.
Referenced by _bt_pagedel(), _bt_rightsib_halfdeadflag(), _bt_unlink_halfdead_page(), bt_downlink_missing_check(), btvacuumpage(), and palloc_btree_page().
#define P_ISLEAF | ( | opaque | ) | (((opaque)->btpo_flags & BTP_LEAF) != 0) |
Definition at line 215 of file nbtree.h.
Referenced by _bt_binsrch(), _bt_binsrch_insert(), _bt_check_natts(), _bt_check_third_page(), _bt_compare(), _bt_delete_or_dedup_one_page(), _bt_endpoint(), _bt_findinsertloc(), _bt_findsplitloc(), _bt_insert_parent(), _bt_insertonpg(), _bt_mark_page_halfdead(), _bt_pagedel(), _bt_rightsib_halfdeadflag(), _bt_search(), _bt_search_insert(), _bt_split(), _bt_unlink_halfdead_page(), bt_check_level_from_leftmost(), bt_downlink_missing_check(), bt_page_items_bytea(), bt_page_items_internal(), bt_right_page_check_scankey(), bt_target_page_check(), btree_mask(), btvacuumpage(), GetBTPageStatistics(), invariant_l_nontarget_offset(), invariant_l_offset(), offset_is_negative_infinity(), palloc_btree_page(), pgstat_btree_page(), and pgstatindex_impl().
#define P_ISMETA | ( | opaque | ) | (((opaque)->btpo_flags & BTP_META) != 0) |
Definition at line 218 of file nbtree.h.
Referenced by _bt_getmeta(), _bt_gettrueroot(), bt_page_items_bytea(), and palloc_btree_page().
#define P_ISROOT | ( | opaque | ) | (((opaque)->btpo_flags & BTP_ROOT) != 0) |
Definition at line 216 of file nbtree.h.
Referenced by _bt_insertonpg(), _bt_mark_page_halfdead(), _bt_pagedel(), _bt_unlink_halfdead_page(), bt_check_level_from_leftmost(), bt_downlink_missing_check(), and GetBTPageStatistics().
#define P_LEFTMOST | ( | opaque | ) | ((opaque)->btpo_prev == P_NONE) |
Definition at line 213 of file nbtree.h.
Referenced by _bt_buildadd(), _bt_finish_split(), _bt_getroot(), _bt_insertonpg(), _bt_uppershutdown(), _bt_walk_left(), bt_check_level_from_leftmost(), and bt_child_highkey_check().
#define P_NONE 0 |
Definition at line 207 of file nbtree.h.
Referenced by _bt_blnewpage(), _bt_buildadd(), _bt_first(), _bt_get_endpoint(), _bt_getroot(), _bt_getrootheight(), _bt_gettrueroot(), _bt_leftsib_splitflag(), _bt_metaversion(), _bt_newroot(), _bt_parallel_seize(), _bt_readnextpage(), _bt_rightsib_halfdeadflag(), _bt_unlink_halfdead_page(), _bt_uppershutdown(), bt_check_every_level(), bt_check_level_from_leftmost(), bt_child_highkey_check(), btbuildempty(), btree_xlog_newroot(), btree_xlog_split(), btree_xlog_unlink_page(), btvacuumpage(), and pgstatindex_impl().
#define P_RIGHTMOST | ( | opaque | ) | ((opaque)->btpo_next == P_NONE) |
Definition at line 214 of file nbtree.h.
Referenced by _bt_check_natts(), _bt_check_unique(), _bt_dedup_pass(), _bt_endpoint(), _bt_findinsertloc(), _bt_findsplitloc(), _bt_finish_split(), _bt_get_endpoint(), _bt_getroot(), _bt_getstackbuf(), _bt_gettrueroot(), _bt_insertonpg(), _bt_lock_subtree_parent(), _bt_mark_page_halfdead(), _bt_moveright(), _bt_pagedel(), _bt_readpage(), _bt_search_insert(), _bt_split(), _bt_stepright(), _bt_unlink_halfdead_page(), _bt_walk_left(), bt_check_level_from_leftmost(), bt_child_highkey_check(), bt_downlink_missing_check(), bt_page_items_bytea(), bt_page_items_internal(), bt_right_page_check_scankey(), bt_target_page_check(), btree_xlog_dedup(), btvacuumpage(), and palloc_btree_page().
#define PROGRESS_BTREE_PHASE_INDEXBUILD_TABLESCAN 2 |
Definition at line 989 of file nbtree.h.
Referenced by _bt_spools_heapscan(), and btbuildphasename().
#define PROGRESS_BTREE_PHASE_LEAF_LOAD 5 |
Definition at line 992 of file nbtree.h.
Referenced by _bt_leafbuild(), and btbuildphasename().
#define PROGRESS_BTREE_PHASE_PERFORMSORT_1 3 |
Definition at line 990 of file nbtree.h.
Referenced by _bt_leafbuild(), and btbuildphasename().
#define PROGRESS_BTREE_PHASE_PERFORMSORT_2 4 |
Definition at line 991 of file nbtree.h.
Referenced by _bt_leafbuild(), and btbuildphasename().
#define SK_BT_DESC (INDOPTION_DESC << SK_BT_INDOPTION_SHIFT) |
Definition at line 958 of file nbtree.h.
Referenced by _bt_check_rowcompare(), _bt_compare(), _bt_compare_scankey_args(), _bt_first(), _bt_fix_scankey_strategy(), _bt_load(), tuplesort_begin_cluster(), and tuplesort_begin_index_btree().
#define SK_BT_INDOPTION_SHIFT 24 /* must clear the above bits */ |
Definition at line 957 of file nbtree.h.
Referenced by _bt_fix_scankey_strategy(), and _bt_mkscankey().
#define SK_BT_NULLS_FIRST (INDOPTION_NULLS_FIRST << SK_BT_INDOPTION_SHIFT) |
Definition at line 959 of file nbtree.h.
Referenced by _bt_check_rowcompare(), _bt_checkkeys(), _bt_compare(), _bt_compare_scankey_args(), _bt_first(), _bt_fix_scankey_strategy(), _bt_load(), tuplesort_begin_cluster(), and tuplesort_begin_index_btree().
#define SK_BT_REQBKWD 0x00020000 /* required to continue backward scan */ |
Definition at line 956 of file nbtree.h.
Referenced by _bt_check_rowcompare(), _bt_checkkeys(), and _bt_mark_scankey_required().
#define SK_BT_REQFWD 0x00010000 /* required to continue forward scan */ |
Definition at line 955 of file nbtree.h.
Referenced by _bt_check_rowcompare(), _bt_checkkeys(), and _bt_mark_scankey_required().
typedef struct BTArrayKeyInfo BTArrayKeyInfo |
typedef struct BTDedupInterval BTDedupInterval |
typedef BTDedupStateData* BTDedupState |
typedef struct BTDedupStateData BTDedupStateData |
typedef BTInsertStateData* BTInsertState |
typedef struct BTInsertStateData BTInsertStateData |
typedef struct BTMetaPageData BTMetaPageData |
typedef BTPageOpaqueData* BTPageOpaque |
typedef struct BTPageOpaqueData BTPageOpaqueData |
typedef BTScanInsertData* BTScanInsert |
typedef struct BTScanInsertData BTScanInsertData |
typedef BTScanOpaqueData* BTScanOpaque |
typedef struct BTScanOpaqueData BTScanOpaqueData |
typedef BTScanPosData* BTScanPos |
typedef struct BTScanPosData BTScanPosData |
typedef struct BTScanPosItem BTScanPosItem |
typedef BTStackData* BTStack |
typedef struct BTStackData BTStackData |
typedef BTVacuumPostingData* BTVacuumPosting |
typedef struct BTVacuumPostingData BTVacuumPostingData |
bool _bt_advance_array_keys | ( | IndexScanDesc | scan, |
ScanDirection | dir | ||
) |
Definition at line 544 of file nbtutils.c.
References _bt_parallel_advance_array_keys(), BTScanOpaqueData::arrayKeyData, BTScanOpaqueData::arrayKeys, BTArrayKeyInfo::cur_elem, BTArrayKeyInfo::elem_values, i, BTArrayKeyInfo::num_elems, BTScanOpaqueData::numArrayKeys, IndexScanDescData::opaque, IndexScanDescData::parallel_scan, BTArrayKeyInfo::scan_key, ScanDirectionIsBackward, and ScanKeyData::sk_argument.
Referenced by btgetbitmap(), and btgettuple().
Definition at line 2692 of file nbtutils.c.
References BTEQUALIMAGE_PROC, BTSortArrayContext::collation, DatumGetBool, DEBUG1, elog, get_opfamily_proc(), i, IndexRelationGetNumberOfAttributes, IndexRelationGetNumberOfKeyAttributes, IsSystemRelation(), ObjectIdGetDatum, OidFunctionCall1Coll(), OidIsValid, RelationData::rd_indcollation, RelationData::rd_opcintype, RelationData::rd_opfamily, and RelationGetRelationName.
Referenced by _bt_leafbuild(), bt_index_check_internal(), and btbuildempty().
OffsetNumber _bt_binsrch_insert | ( | Relation | rel, |
BTInsertState | insertstate | ||
) |
Definition at line 447 of file nbtsearch.c.
References _bt_binsrch_posting(), _bt_compare(), Assert, BTInsertStateData::bounds_valid, BTInsertStateData::buf, BufferGetPage, InvalidOffsetNumber, BTInsertStateData::itup_key, sort-test::key, BTInsertStateData::low, BTScanInsertData::nextkey, P_FIRSTDATAKEY, P_ISLEAF, PageGetMaxOffsetNumber, PageGetSpecialPointer, BTInsertStateData::postingoff, BTScanInsertData::scantid, BTInsertStateData::stricthigh, and unlikely.
Referenced by _bt_check_unique(), _bt_findinsertloc(), and bt_rootdescend().
Definition at line 299 of file nbtdedup.c.
References _bt_bottomupdel_finish_pending(), _bt_dedup_save_htid(), _bt_dedup_start_pending(), _bt_delitems_delete_check(), _bt_keep_natts_fast(), Assert, BTDedupStateData::base, BTDedupStateData::baseoff, BTDedupStateData::basetupsize, TM_IndexDeleteOp::bottomup, TM_IndexDeleteOp::bottomupfreespace, BufferGetPage, BTDedupStateData::deduplicate, TM_IndexDeleteOp::deltids, BTDedupStateData::htids, IndexRelationGetNumberOfKeyAttributes, InvalidOffsetNumber, ItemIdIsDead, Max, BTDedupStateData::maxpostingsize, MaxTIDsPerBTreePage, TM_IndexDeleteOp::ndeltids, BTDedupStateData::nhtids, BTDedupStateData::nintervals, BTDedupStateData::nitems, BTDedupStateData::nmaxitems, OffsetNumberNext, P_FIRSTDATAKEY, PageGetExactFreeSpace(), PageGetItem, PageGetItemId, PageGetMaxOffsetNumber, PageGetSpecialPointer, palloc(), pfree(), BTDedupStateData::phystupsize, and TM_IndexDeleteOp::status.
Referenced by _bt_delete_or_dedup_one_page().
bool _bt_check_natts | ( | Relation | rel, |
bool | heapkeyspace, | ||
Page | page, | ||
OffsetNumber | offnum | ||
) |
Definition at line 2466 of file nbtutils.c.
References Assert, BT_OFFSET_MASK, BT_PIVOT_HEAP_TID_ATTR, BTreeTupleGetHeapTID(), BTreeTupleGetNAtts, BTreeTupleIsPivot(), BTreeTupleIsPosting(), FirstOffsetNumber, INDEX_MAX_KEYS, IndexRelationGetNumberOfAttributes, IndexRelationGetNumberOfKeyAttributes, ItemPointerGetOffsetNumber, ItemPointerGetOffsetNumberNoCheck, P_FIRSTDATAKEY, P_HIKEY, P_IGNORE, P_ISLEAF, P_RIGHTMOST, PageGetItem, PageGetItemId, PageGetMaxOffsetNumber, PageGetSpecialPointer, StaticAssertStmt, and IndexTupleData::t_tid.
Referenced by _bt_compare(), and bt_target_page_check().
void _bt_check_third_page | ( | Relation | rel, |
Relation | heap, | ||
bool | needheaptidspace, | ||
Page | page, | ||
IndexTuple | newtup | ||
) |
Definition at line 2634 of file nbtutils.c.
References BTMaxItemSize, BTMaxItemSizeNoHeapTid, BTREE_NOVAC_VERSION, BTREE_VERSION, BTreeTupleGetHeapTID(), elog, ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, errtableconstraint(), IndexTupleSize, ItemPointerGetBlockNumber, ItemPointerGetOffsetNumber, MAXALIGN, P_ISLEAF, PageGetSpecialPointer, and RelationGetRelationName.
Referenced by _bt_buildadd(), and _bt_findinsertloc().
bool _bt_checkkeys | ( | IndexScanDesc | scan, |
IndexTuple | tuple, | ||
int | tupnatts, | ||
ScanDirection | dir, | ||
bool * | continuescan | ||
) |
Definition at line 1355 of file nbtutils.c.
References _bt_check_rowcompare(), Assert, BTreeTupleGetNAtts, BTreeTupleIsPivot(), DatumGetBool, FunctionCall2Coll(), index_getattr, IndexScanDescData::indexRelation, sort-test::key, BTScanOpaqueData::keyData, BTScanOpaqueData::numberOfKeys, IndexScanDescData::opaque, RelationGetDescr, ScanDirectionIsBackward, ScanDirectionIsForward, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_NULLS_FIRST, SK_BT_REQBKWD, SK_BT_REQFWD, ScanKeyData::sk_collation, ScanKeyData::sk_flags, ScanKeyData::sk_func, SK_ISNULL, SK_ROW_HEADER, SK_SEARCHNOTNULL, SK_SEARCHNULL, and test().
Referenced by _bt_readpage().
Definition at line 732 of file nbtpage.c.
References BufferGetBlockNumber(), BufferGetPage, ereport, errcode(), errhint(), errmsg(), ERROR, MAXALIGN, PageGetSpecialSize, PageIsNew, and RelationGetRelationName.
Referenced by _bt_getbuf(), _bt_relandgetbuf(), _bt_search_insert(), bt_recheck_sibling_links(), btvacuumpage(), and palloc_btree_page().
int32 _bt_compare | ( | Relation | rel, |
BTScanInsert | key, | ||
Page | page, | ||
OffsetNumber | offnum | ||
) |
Definition at line 644 of file nbtsearch.c.
References _bt_check_natts(), BTScanInsertData::allequalimage, Assert, BTreeTupleGetHeapTID(), BTreeTupleGetMaxHeapTID(), BTreeTupleGetNAtts, BTreeTupleIsPosting(), DatumGetInt32, FunctionCall2Coll(), BTScanInsertData::heapkeyspace, i, index_getattr, IndexRelationGetNumberOfKeyAttributes, INVERT_COMPARE_RESULT, ItemPointerCompare(), BTScanInsertData::keysz, Min, P_FIRSTDATAKEY, P_ISLEAF, PageGetItem, PageGetItemId, PageGetSpecialPointer, BTScanInsertData::pivotsearch, RelationGetDescr, BTScanInsertData::scankeys, BTScanInsertData::scantid, ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_DESC, SK_BT_NULLS_FIRST, ScanKeyData::sk_collation, ScanKeyData::sk_flags, ScanKeyData::sk_func, and SK_ISNULL.
Referenced by _bt_binsrch(), _bt_binsrch_insert(), _bt_check_unique(), _bt_findinsertloc(), _bt_moveright(), _bt_search_insert(), bt_rootdescend(), invariant_g_offset(), invariant_l_nontarget_offset(), invariant_l_offset(), and invariant_leq_offset().
Definition at line 1035 of file nbtpage.c.
References BufferGetPage, ConditionalLockBuffer(), RelationUsesLocalBuffers, and VALGRIND_MAKE_MEM_DEFINED.
Referenced by _bt_getbuf(), and _bt_search_insert().
Size _bt_dedup_finish_pending | ( | Page | newpage, |
BTDedupState | state | ||
) |
Definition at line 545 of file nbtdedup.c.
References _bt_form_posting(), Assert, BTDedupStateData::base, BTDedupInterval::baseoff, BTDedupStateData::baseoff, elog, ERROR, BTDedupStateData::htids, IndexTupleSize, BTDedupStateData::intervals, InvalidOffsetNumber, MAXALIGN, BTDedupStateData::nhtids, BTDedupStateData::nintervals, BTDedupInterval::nitems, BTDedupStateData::nitems, OffsetNumberNext, PageAddItem, PageGetMaxOffsetNumber, pfree(), and BTDedupStateData::phystupsize.
Referenced by _bt_dedup_pass(), and btree_xlog_dedup().
void _bt_dedup_pass | ( | Relation | rel, |
Buffer | buf, | ||
Relation | heapRel, | ||
IndexTuple | newitem, | ||
Size | newitemsz, | ||
bool | checkingunique | ||
) |
Definition at line 54 of file nbtdedup.c.
References _bt_dedup_finish_pending(), _bt_dedup_save_htid(), _bt_dedup_start_pending(), _bt_do_singleval(), _bt_keep_natts_fast(), _bt_singleval_fillfactor(), Assert, BTDedupStateData::base, BTDedupStateData::baseoff, BTDedupStateData::basetupsize, BTMaxItemSize, BTP_HAS_GARBAGE, BTPageOpaqueData::btpo_flags, BufferGetPage, BTDedupStateData::deduplicate, elog, END_CRIT_SECTION, ERROR, BTDedupStateData::htids, INDEX_SIZE_MASK, IndexRelationGetNumberOfKeyAttributes, BTDedupStateData::intervals, InvalidOffsetNumber, ItemIdGetLength, ItemIdIsDead, MarkBufferDirty(), BTDedupStateData::maxpostingsize, Min, BTDedupStateData::nhtids, xl_btree_dedup::nintervals, BTDedupStateData::nintervals, BTDedupStateData::nitems, BTDedupStateData::nmaxitems, OffsetNumberNext, P_FIRSTDATAKEY, P_HAS_GARBAGE, P_HIKEY, P_RIGHTMOST, PageAddItem, PageGetExactFreeSpace(), PageGetItem, PageGetItemId, PageGetLSN, PageGetMaxOffsetNumber, PageGetSpecialPointer, PageGetTempPageCopySpecial(), PageRestoreTempPage(), PageSetLSN, palloc(), pfree(), BTDedupStateData::phystupsize, REGBUF_STANDARD, RelationNeedsWAL, SizeOfBtreeDedup, START_CRIT_SECTION, XLOG_BTREE_DEDUP, XLogBeginInsert(), XLogInsert(), XLogRegisterBufData(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by _bt_delete_or_dedup_one_page().
bool _bt_dedup_save_htid | ( | BTDedupState | state, |
IndexTuple | itup | ||
) |
Definition at line 474 of file nbtdedup.c.
References Assert, BTDedupStateData::basetupsize, BTreeTupleGetNPosting(), BTreeTupleGetPosting(), BTreeTupleIsPivot(), BTreeTupleIsPosting(), BTDedupStateData::htids, IndexTupleSize, MAXALIGN, BTDedupStateData::maxpostingsize, BTDedupStateData::nhtids, BTDedupStateData::nitems, BTDedupStateData::nmaxitems, BTDedupStateData::phystupsize, and IndexTupleData::t_tid.
Referenced by _bt_bottomupdel_pass(), _bt_dedup_pass(), _bt_load(), and btree_xlog_dedup().
void _bt_dedup_start_pending | ( | BTDedupState | state, |
IndexTuple | base, | ||
OffsetNumber | baseoff | ||
) |
Definition at line 423 of file nbtdedup.c.
References Assert, BTDedupStateData::base, BTDedupInterval::baseoff, BTDedupStateData::baseoff, BTDedupStateData::basetupsize, BTreeTupleGetNPosting(), BTreeTupleGetPosting(), BTreeTupleGetPostingOffset(), BTreeTupleIsPivot(), BTreeTupleIsPosting(), BTDedupStateData::htids, IndexTupleSize, BTDedupStateData::intervals, MAXALIGN, BTDedupStateData::nhtids, BTDedupStateData::nintervals, BTDedupStateData::nitems, BTDedupStateData::phystupsize, and IndexTupleData::t_tid.
Referenced by _bt_bottomupdel_pass(), _bt_dedup_pass(), _bt_load(), and btree_xlog_dedup().
void _bt_delitems_delete_check | ( | Relation | rel, |
Buffer | buf, | ||
Relation | heapRel, | ||
TM_IndexDeleteOp * | delstate | ||
) |
Definition at line 1494 of file nbtpage.c.
References _bt_delitems_cmp(), _bt_delitems_delete(), Assert, TM_IndexDeleteOp::bottomup, BTreeTupleGetHeapTID(), BTreeTupleGetMaxHeapTID(), BTreeTupleGetNPosting(), BTreeTupleGetPostingN(), BTreeTupleIsPosting(), BufferGetPage, BTVacuumPostingData::deletetids, TM_IndexDeleteOp::deltids, i, TM_IndexDelete::id, TM_IndexStatus::idxoffnum, InvalidOffsetNumber, InvalidTransactionId, ItemPointerCompare(), ItemPointerEquals(), BTVacuumPostingData::itup, TM_IndexStatus::knowndeletable, MaxIndexTuplesPerPage, BTVacuumPostingData::ndeletedtids, TM_IndexDeleteOp::ndeltids, OffsetNumberIsValid, offsetof, PageGetItem, PageGetItemId, palloc(), pfree(), qsort, RelationNeedsWAL, TM_IndexDeleteOp::status, IndexTupleData::t_tid, table_index_delete_tuples(), TM_IndexDelete::tid, BTVacuumPostingData::updatedoffset, and XLogStandbyInfoActive.
Referenced by _bt_bottomupdel_pass(), and _bt_simpledel_pass().
void _bt_delitems_vacuum | ( | Relation | rel, |
Buffer | buf, | ||
OffsetNumber * | deletable, | ||
int | ndeletable, | ||
BTVacuumPosting * | updatable, | ||
int | nupdatable | ||
) |
Definition at line 1131 of file nbtpage.c.
References _bt_delitems_update(), Assert, BTP_HAS_GARBAGE, BTPageOpaqueData::btpo_cycleid, BTPageOpaqueData::btpo_flags, BufferGetBlockNumber(), BufferGetPage, elog, END_CRIT_SECTION, i, IndexTupleSize, BTVacuumPostingData::itup, MarkBufferDirty(), MAXALIGN, MaxIndexTuplesPerPage, xl_btree_vacuum::ndeleted, xl_btree_vacuum::nupdated, PageGetSpecialPointer, PageIndexMultiDelete(), PageIndexTupleOverwrite(), PageSetLSN, PANIC, pfree(), REGBUF_STANDARD, RelationGetRelationName, RelationNeedsWAL, SizeOfBtreeVacuum, START_CRIT_SECTION, XLOG_BTREE_VACUUM, XLogBeginInsert(), XLogInsert(), XLogRegisterBufData(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by btvacuumpage().
bool _bt_doinsert | ( | Relation | rel, |
IndexTuple | itup, | ||
IndexUniqueCheck | checkUnique, | ||
bool | indexUnchanged, | ||
Relation | heapRel | ||
) |
Definition at line 99 of file nbtinsert.c.
References _bt_check_unique(), _bt_findinsertloc(), _bt_freestack(), _bt_insertonpg(), _bt_mkscankey(), _bt_relbuf(), _bt_search_insert(), BTScanInsertData::anynullkeys, Assert, BTInsertStateData::bounds_valid, BTInsertStateData::buf, BufferGetBlockNumber(), CheckForSerializableConflictIn(), BTScanInsertData::heapkeyspace, IndexTupleSize, InvalidBuffer, BTInsertStateData::itemsz, BTInsertStateData::itup, BTInsertStateData::itup_key, MAXALIGN, pfree(), BTInsertStateData::postingoff, BTScanInsertData::scantid, SpeculativeInsertionWait(), IndexTupleData::t_tid, TransactionIdIsValid, UNIQUE_CHECK_EXISTING, UNIQUE_CHECK_NO, unlikely, XactLockTableWait(), and XLTW_InsertIndex.
Referenced by btinsert().
void _bt_end_vacuum | ( | Relation | rel | ) |
Definition at line 2026 of file nbtutils.c.
References LockRelId::dbId, i, LockInfoData::lockRelId, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), BTVacInfo::num_vacuums, RelationData::rd_lockInfo, LockRelId::relId, BTOneVacInfo::relid, and BTVacInfo::vacuums.
Referenced by _bt_end_vacuum_callback(), and btbulkdelete().
void _bt_end_vacuum_callback | ( | int | code, |
Datum | arg | ||
) |
Definition at line 2054 of file nbtutils.c.
References _bt_end_vacuum(), and DatumGetPointer.
Referenced by btbulkdelete().
OffsetNumber _bt_findsplitloc | ( | Relation | rel, |
Page | origpage, | ||
OffsetNumber | newitemoff, | ||
Size | newitemsz, | ||
IndexTuple | newitem, | ||
bool * | newitemonleft | ||
) |
Definition at line 130 of file nbtsplitloc.c.
References _bt_afternewitemoff(), _bt_bestsplitloc(), _bt_defaultinterval(), _bt_deltasortsplits(), _bt_recsplitloc(), _bt_strategy(), Assert, BTGetFillFactor, BTREE_NONLEAF_FILLFACTOR, BTREE_SINGLEVAL_FILLFACTOR, BTreeTupleIsPosting(), elog, ERROR, SplitPoint::firstrightoff, i, IndexRelationGetNumberOfKeyAttributes, FindSplitData::interval, FindSplitData::is_leaf, FindSplitData::is_rightmost, ItemIdGetLength, FindSplitData::leftspace, MAXALIGN, FindSplitData::maxsplits, FindSplitData::minfirstrightsz, FindSplitData::newitem, FindSplitData::newitemoff, SplitPoint::newitemonleft, FindSplitData::newitemsz, FindSplitData::nsplits, OffsetNumberNext, FindSplitData::olddataitemstotal, FindSplitData::origpage, P_FIRSTDATAKEY, P_HIKEY, P_ISLEAF, P_RIGHTMOST, PageGetExactFreeSpace(), PageGetItemId, PageGetMaxOffsetNumber, PageGetPageSize, PageGetSpecialPointer, palloc(), pfree(), FindSplitData::rel, RelationGetRelationName, FindSplitData::rightspace, SizeOfPageHeaderData, SPLIT_DEFAULT, SPLIT_MANY_DUPLICATES, SPLIT_SINGLE_VALUE, and FindSplitData::splits.
Referenced by _bt_split().
Definition at line 2215 of file nbtinsert.c.
References _bt_getbuf(), _bt_insert_parent(), _bt_relbuf(), Assert, BT_WRITE, BTMetaPageData::btm_root, BTPageGetMeta, BTPageOpaqueData::btpo_next, BTREE_METAPAGE, BufferGetBlockNumber(), BufferGetPage, DEBUG1, elog, P_INCOMPLETE_SPLIT, P_LEFTMOST, P_RIGHTMOST, and PageGetSpecialPointer.
Referenced by _bt_getstackbuf(), _bt_moveright(), and _bt_stepright().
bool _bt_first | ( | IndexScanDesc | scan, |
ScanDirection | dir | ||
) |
Definition at line 848 of file nbtsearch.c.
References _bt_binsrch(), _bt_drop_lock_and_maybe_pin(), _bt_endpoint(), _bt_freestack(), _bt_initialize_more_data(), _bt_metaversion(), _bt_parallel_done(), _bt_parallel_readpage(), _bt_parallel_seize(), _bt_preprocess_keys(), _bt_readpage(), _bt_search(), _bt_steppage(), _bt_unlockbuf(), Assert, BT_READ, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, BTORDER_PROC, BTScanPosInvalidate, BTScanPosIsValid, buf, BTScanPosData::buf, BufferGetBlockNumber(), BufferIsValid, cur, BTScanOpaqueData::currPos, BTScanOpaqueData::currTuples, DatumGetPointer, elog, ERROR, get_opfamily_proc(), i, index_getprocinfo(), INDEX_MAX_KEYS, IndexScanDescData::indexRelation, InvalidBlockNumber, InvalidOid, InvalidStrategy, BTScanPosData::itemIndex, BTScanPosData::items, BTScanOpaqueData::keyData, BTScanOpaqueData::numberOfKeys, OffsetNumberPrev, IndexScanDescData::opaque, P_NONE, IndexScanDescData::parallel_scan, pgstat_count_index_scan, PredicateLockPage(), PredicateLockRelation(), BTScanOpaqueData::qual_ok, RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, RelationGetRelationName, ScanDirectionIsBackward, ScanDirectionIsForward, ScanKeyEntryInitialize(), ScanKeyEntryInitializeWithInfo(), ScanKeyData::sk_argument, ScanKeyData::sk_attno, SK_BT_DESC, SK_BT_NULLS_FIRST, ScanKeyData::sk_collation, ScanKeyData::sk_flags, SK_ISNULL, SK_ROW_END, SK_ROW_HEADER, SK_ROW_MEMBER, SK_SEARCHNOTNULL, ScanKeyData::sk_strategy, ScanKeyData::sk_subtype, status(), IndexScanDescData::xs_heaptid, IndexScanDescData::xs_itup, IndexScanDescData::xs_snapshot, and IndexScanDescData::xs_want_itup.
Referenced by btgetbitmap(), and btgettuple().
IndexTuple _bt_form_posting | ( | IndexTuple | base, |
ItemPointer | htids, | ||
int | nhtids | ||
) |
Definition at line 859 of file nbtdedup.c.
References Assert, BTreeTupleGetPosting(), BTreeTupleGetPostingOffset(), BTreeTupleIsPivot(), BTreeTupleIsPosting(), BTreeTupleSetPosting(), INDEX_ALT_TID_MASK, INDEX_SIZE_MASK, IndexTupleSize, ItemPointerCopy, ItemPointerIsValid, MAXALIGN, palloc0(), PG_UINT16_MAX, IndexTupleData::t_info, and IndexTupleData::t_tid.
Referenced by _bt_dedup_finish_pending(), _bt_sort_dedup_finish_pending(), and bt_posting_plain_tuple().