|
static void | BTPageSetDeleted (Page page, FullTransactionId safexid) |
|
static FullTransactionId | BTPageGetDeleteXid (Page page) |
|
static bool | BTPageIsRecyclable (Page page, Relation heaprel) |
|
| StaticAssertDecl (BT_OFFSET_MASK >=INDEX_MAX_KEYS, "BT_OFFSET_MASK can't fit INDEX_MAX_KEYS") |
|
static bool | BTreeTupleIsPivot (IndexTuple itup) |
|
static bool | BTreeTupleIsPosting (IndexTuple itup) |
|
static void | BTreeTupleSetPosting (IndexTuple itup, uint16 nhtids, int postingoffset) |
|
static uint16 | BTreeTupleGetNPosting (IndexTuple posting) |
|
static uint32 | BTreeTupleGetPostingOffset (IndexTuple posting) |
|
static ItemPointer | BTreeTupleGetPosting (IndexTuple posting) |
|
static ItemPointer | BTreeTupleGetPostingN (IndexTuple posting, int n) |
|
static BlockNumber | BTreeTupleGetDownLink (IndexTuple pivot) |
|
static void | BTreeTupleSetDownLink (IndexTuple pivot, BlockNumber blkno) |
|
static void | BTreeTupleSetNAtts (IndexTuple itup, uint16 nkeyatts, bool heaptid) |
|
static BlockNumber | BTreeTupleGetTopParent (IndexTuple leafhikey) |
|
static void | BTreeTupleSetTopParent (IndexTuple leafhikey, BlockNumber blkno) |
|
static ItemPointer | BTreeTupleGetHeapTID (IndexTuple itup) |
|
static ItemPointer | BTreeTupleGetMaxHeapTID (IndexTuple itup) |
|
void | btbuildempty (Relation index) |
|
bool | btinsert (Relation rel, Datum *values, bool *isnull, ItemPointer ht_ctid, Relation heapRel, IndexUniqueCheck checkUnique, bool indexUnchanged, struct IndexInfo *indexInfo) |
|
IndexScanDesc | btbeginscan (Relation rel, int nkeys, int norderbys) |
|
Size | btestimateparallelscan (void) |
|
void | btinitparallelscan (void *target) |
|
bool | btgettuple (IndexScanDesc scan, ScanDirection dir) |
|
int64 | btgetbitmap (IndexScanDesc scan, TIDBitmap *tbm) |
|
void | btrescan (IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys) |
|
void | btparallelrescan (IndexScanDesc scan) |
|
void | btendscan (IndexScanDesc scan) |
|
void | btmarkpos (IndexScanDesc scan) |
|
void | btrestrpos (IndexScanDesc scan) |
|
IndexBulkDeleteResult * | btbulkdelete (IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state) |
|
IndexBulkDeleteResult * | btvacuumcleanup (IndexVacuumInfo *info, IndexBulkDeleteResult *stats) |
|
bool | btcanreturn (Relation index, int attno) |
|
bool | _bt_parallel_seize (IndexScanDesc scan, BlockNumber *pageno) |
|
void | _bt_parallel_release (IndexScanDesc scan, BlockNumber scan_page) |
|
void | _bt_parallel_done (IndexScanDesc scan) |
|
void | _bt_parallel_advance_array_keys (IndexScanDesc scan) |
|
void | _bt_dedup_pass (Relation rel, Buffer buf, IndexTuple newitem, Size newitemsz, bool bottomupdedup) |
|
bool | _bt_bottomupdel_pass (Relation rel, Buffer buf, Relation heapRel, Size newitemsz) |
|
void | _bt_dedup_start_pending (BTDedupState state, IndexTuple base, OffsetNumber baseoff) |
|
bool | _bt_dedup_save_htid (BTDedupState state, IndexTuple itup) |
|
Size | _bt_dedup_finish_pending (Page newpage, BTDedupState state) |
|
IndexTuple | _bt_form_posting (IndexTuple base, ItemPointer htids, int nhtids) |
|
void | _bt_update_posting (BTVacuumPosting vacposting) |
|
IndexTuple | _bt_swap_posting (IndexTuple newitem, IndexTuple oposting, int postingoff) |
|
bool | _bt_doinsert (Relation rel, IndexTuple itup, IndexUniqueCheck checkUnique, bool indexUnchanged, Relation heapRel) |
|
void | _bt_finish_split (Relation rel, Relation heaprel, Buffer lbuf, BTStack stack) |
|
Buffer | _bt_getstackbuf (Relation rel, Relation heaprel, BTStack stack, BlockNumber child) |
|
OffsetNumber | _bt_findsplitloc (Relation rel, Page origpage, OffsetNumber newitemoff, Size newitemsz, IndexTuple newitem, bool *newitemonleft) |
|
void | _bt_initmetapage (Page page, BlockNumber rootbknum, uint32 level, bool allequalimage) |
|
bool | _bt_vacuum_needs_cleanup (Relation rel, Relation heaprel) |
|
void | _bt_set_cleanup_info (Relation rel, Relation heaprel, BlockNumber num_delpages) |
|
void | _bt_upgrademetapage (Page page) |
|
Buffer | _bt_getroot (Relation rel, Relation heaprel, int access) |
|
Buffer | _bt_gettrueroot (Relation rel, Relation heaprel) |
|
int | _bt_getrootheight (Relation rel, Relation heaprel) |
|
void | _bt_metaversion (Relation rel, Relation heaprel, bool *heapkeyspace, bool *allequalimage) |
|
void | _bt_checkpage (Relation rel, Buffer buf) |
|
Buffer | _bt_getbuf (Relation rel, Relation heaprel, BlockNumber blkno, int access) |
|
Buffer | _bt_relandgetbuf (Relation rel, Buffer obuf, BlockNumber blkno, int access) |
|
void | _bt_relbuf (Relation rel, Buffer buf) |
|
void | _bt_lockbuf (Relation rel, Buffer buf, int access) |
|
void | _bt_unlockbuf (Relation rel, Buffer buf) |
|
bool | _bt_conditionallockbuf (Relation rel, Buffer buf) |
|
void | _bt_upgradelockbufcleanup (Relation rel, Buffer buf) |
|
void | _bt_pageinit (Page page, Size size) |
|
void | _bt_delitems_vacuum (Relation rel, Buffer buf, OffsetNumber *deletable, int ndeletable, BTVacuumPosting *updatable, int nupdatable) |
|
void | _bt_delitems_delete_check (Relation rel, Buffer buf, Relation heapRel, TM_IndexDeleteOp *delstate) |
|
void | _bt_pagedel (Relation rel, Buffer leafbuf, BTVacState *vstate) |
|
void | _bt_pendingfsm_init (Relation rel, BTVacState *vstate, bool cleanuponly) |
|
void | _bt_pendingfsm_finalize (Relation rel, BTVacState *vstate) |
|
BTStack | _bt_search (Relation rel, Relation heaprel, BTScanInsert key, Buffer *bufP, int access, Snapshot snapshot) |
|
Buffer | _bt_moveright (Relation rel, Relation heaprel, BTScanInsert key, Buffer buf, bool forupdate, BTStack stack, int access, Snapshot snapshot) |
|
OffsetNumber | _bt_binsrch_insert (Relation rel, BTInsertState insertstate) |
|
int32 | _bt_compare (Relation rel, BTScanInsert key, Page page, OffsetNumber offnum) |
|
bool | _bt_first (IndexScanDesc scan, ScanDirection dir) |
|
bool | _bt_next (IndexScanDesc scan, ScanDirection dir) |
|
Buffer | _bt_get_endpoint (Relation rel, Relation heaprel, uint32 level, bool rightmost, Snapshot snapshot) |
|
BTScanInsert | _bt_mkscankey (Relation rel, Relation heaprel, IndexTuple itup) |
|
void | _bt_freestack (BTStack stack) |
|
void | _bt_preprocess_array_keys (IndexScanDesc scan) |
|
void | _bt_start_array_keys (IndexScanDesc scan, ScanDirection dir) |
|
bool | _bt_advance_array_keys (IndexScanDesc scan, ScanDirection dir) |
|
void | _bt_mark_array_keys (IndexScanDesc scan) |
|
void | _bt_restore_array_keys (IndexScanDesc scan) |
|
void | _bt_preprocess_keys (IndexScanDesc scan) |
|
bool | _bt_checkkeys (IndexScanDesc scan, IndexTuple tuple, int tupnatts, ScanDirection dir, bool *continuescan) |
|
void | _bt_killitems (IndexScanDesc scan) |
|
BTCycleId | _bt_vacuum_cycleid (Relation rel) |
|
BTCycleId | _bt_start_vacuum (Relation rel) |
|
void | _bt_end_vacuum (Relation rel) |
|
void | _bt_end_vacuum_callback (int code, Datum arg) |
|
Size | BTreeShmemSize (void) |
|
void | BTreeShmemInit (void) |
|
bytea * | btoptions (Datum reloptions, bool validate) |
|
bool | btproperty (Oid index_oid, int attno, IndexAMProperty prop, const char *propname, bool *res, bool *isnull) |
|
char * | btbuildphasename (int64 phasenum) |
|
IndexTuple | _bt_truncate (Relation rel, IndexTuple lastleft, IndexTuple firstright, BTScanInsert itup_key) |
|
int | _bt_keep_natts_fast (Relation rel, IndexTuple lastleft, IndexTuple firstright) |
|
bool | _bt_check_natts (Relation rel, bool heapkeyspace, Page page, OffsetNumber offnum) |
|
void | _bt_check_third_page (Relation rel, Relation heap, bool needheaptidspace, Page page, IndexTuple newtup) |
|
bool | _bt_allequalimage (Relation rel, bool debugmessage) |
|
bool | btvalidate (Oid opclassoid) |
|
void | btadjustmembers (Oid opfamilyoid, Oid opclassoid, List *operators, List *functions) |
|
IndexBuildResult * | btbuild (Relation heap, Relation index, struct IndexInfo *indexInfo) |
|
void | _bt_parallel_build_main (dsm_segment *seg, shm_toc *toc) |
|
Definition at line 658 of file nbtsearch.c.
698 ncmpkey =
Min(ntupatts,
key->keysz);
701 scankey =
key->scankeys;
702 for (
int i = 1;
i <= ncmpkey;
i++)
760 if (
key->keysz > ntupatts)
769 if (
key->scantid == NULL)
804 if (
key->heapkeyspace && !
key->pivotsearch &&
805 key->keysz == ntupatts && heapTid == NULL)
#define INVERT_COMPARE_RESULT(var)
int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2)
static ItemPointer BTreeTupleGetMaxHeapTID(IndexTuple itup)
bool _bt_check_natts(Relation rel, bool heapkeyspace, Page page, OffsetNumber offnum)
static int32 DatumGetInt32(Datum X)
References _bt_check_natts(), Assert(), BTPageGetOpaque, BTreeTupleGetHeapTID(), BTreeTupleGetMaxHeapTID(), BTreeTupleGetNAtts, BTreeTupleIsPosting(), DatumGetInt32(), FunctionCall2Coll(), i, index_getattr(), IndexRelationGetNumberOfKeyAttributes, INVERT_COMPARE_RESULT, ItemPointerCompare(), sort-test::key, Min, P_FIRSTDATAKEY, P_ISLEAF, PageGetItem(), PageGetItemId(), RelationGetDescr, 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 58 of file nbtdedup.c.
69 bool singlevalstrat =
false;
85 state->deduplicate =
true;
91 state->basetupsize = 0;
97 state->phystupsize = 0;
99 state->nintervals = 0;
130 elog(
ERROR,
"deduplication failed to add highkey");
133 for (offnum = minoff;
142 if (offnum == minoff)
150 else if (
state->deduplicate &&
190 if (
state->nmaxitems == 5)
192 else if (
state->nmaxitems == 6)
194 state->deduplicate =
false;
195 singlevalstrat =
false;
217 if (
state->nintervals == 0)
void MarkBufferDirty(Buffer buffer)
void PageRestoreTempPage(Page tempPage, Page oldPage)
Page PageGetTempPageCopySpecial(Page page)
static void PageSetLSN(Page page, XLogRecPtr lsn)
static XLogRecPtr PageGetLSN(Page page)
#define PG_USED_FOR_ASSERTS_ONLY
#define ItemIdGetLength(itemId)
#define START_CRIT_SECTION()
#define END_CRIT_SECTION()
static bool _bt_do_singleval(Relation rel, Page page, BTDedupState state, OffsetNumber minoff, IndexTuple newitem)
Size _bt_dedup_finish_pending(Page newpage, BTDedupState state)
static void _bt_singleval_fillfactor(Page page, BTDedupState state, Size newitemsz)
#define P_HAS_GARBAGE(opaque)
#define RelationNeedsWAL(relation)
void XLogRegisterData(char *data, uint32 len)
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
void XLogRegisterBufData(uint8 block_id, char *data, uint32 len)
void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
void XLogBeginInsert(void)
References _bt_dedup_finish_pending(), _bt_dedup_save_htid(), _bt_dedup_start_pending(), _bt_do_singleval(), _bt_keep_natts_fast(), _bt_singleval_fillfactor(), Assert(), BTMaxItemSize, BTP_HAS_GARBAGE, BTPageGetOpaque, BTPageOpaqueData::btpo_flags, buf, BufferGetPage(), elog(), END_CRIT_SECTION, ERROR, INDEX_SIZE_MASK, IndexRelationGetNumberOfKeyAttributes, InvalidOffsetNumber, ItemIdGetLength, ItemIdIsDead, MarkBufferDirty(), Min, xl_btree_dedup::nintervals, OffsetNumberNext, P_FIRSTDATAKEY, P_HAS_GARBAGE, P_HIKEY, P_RIGHTMOST, PageAddItem, PageGetExactFreeSpace(), PageGetItem(), PageGetItemId(), PageGetLSN(), PageGetMaxOffsetNumber(), PageGetTempPageCopySpecial(), PageRestoreTempPage(), PageSetLSN(), palloc(), pfree(), PG_USED_FOR_ASSERTS_ONLY, REGBUF_STANDARD, RelationNeedsWAL, SizeOfBtreeDedup, START_CRIT_SECTION, XLOG_BTREE_DEDUP, XLogBeginInsert(), XLogInsert(), XLogRegisterBufData(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by _bt_delete_or_dedup_one_page().
Definition at line 129 of file nbtsplitloc.c.
149 double fillfactormult;
158 leftspace = rightspace =
177 state.origpage = origpage;
178 state.newitem = newitem;
179 state.newitemsz = newitemsz;
182 state.leftspace = leftspace;
183 state.rightspace = rightspace;
184 state.olddataitemstotal = olddataitemstotal;
185 state.minfirstrightsz = SIZE_MAX;
186 state.newitemoff = newitemoff;
198 state.maxsplits = maxoff;
206 olddataitemstoleft = 0;
224 if (offnum < newitemoff)
226 else if (offnum > newitemoff)
243 olddataitemstoleft += itemsz;
251 Assert(olddataitemstoleft == olddataitemstotal);
252 if (newitemoff > maxoff)
259 if (
state.nsplits == 0)
260 elog(
ERROR,
"could not find a feasible split point for index \"%s\"",
283 usemult =
state.is_rightmost;
286 else if (
state.is_rightmost)
290 fillfactormult = leaffillfactor / 100.0;
303 fillfactormult = leaffillfactor / 100.0;
308 for (
int i = 0;
i <
state.nsplits;
i++)
316 *newitemonleft =
true;
326 fillfactormult = 0.50;
334 fillfactormult = 0.50;
341 leftpage =
state.splits[0];
427 return firstrightoff;
#define BTREE_SINGLEVAL_FILLFACTOR
#define BTGetFillFactor(relation)
#define BTREE_NONLEAF_FILLFACTOR
static void _bt_deltasortsplits(FindSplitData *state, double fillfactormult, bool usemult)
static int _bt_strategy(FindSplitData *state, SplitPoint *leftpage, SplitPoint *rightpage, FindSplitStrat *strategy)
static bool _bt_afternewitemoff(FindSplitData *state, OffsetNumber maxoff, int leaffillfactor, bool *usemult)
static void _bt_recsplitloc(FindSplitData *state, OffsetNumber firstrightoff, bool newitemonleft, int olddataitemstoleft, Size firstrightofforigpagetuplesz)
static OffsetNumber _bt_bestsplitloc(FindSplitData *state, int perfectpenalty, bool *newitemonleft, FindSplitStrat strategy)
static int _bt_defaultinterval(FindSplitData *state)
OffsetNumber firstrightoff
References _bt_afternewitemoff(), _bt_bestsplitloc(), _bt_defaultinterval(), _bt_deltasortsplits(), _bt_recsplitloc(), _bt_strategy(), Assert(), BTGetFillFactor, BTPageGetOpaque, BTREE_NONLEAF_FILLFACTOR, BTREE_SINGLEVAL_FILLFACTOR, BTreeTupleIsPosting(), elog(), ERROR, SplitPoint::firstrightoff, i, IndexRelationGetNumberOfKeyAttributes, ItemIdGetLength, MAXALIGN, SplitPoint::newitemonleft, OffsetNumberNext, P_FIRSTDATAKEY, P_HIKEY, P_ISLEAF, P_RIGHTMOST, PageGetExactFreeSpace(), PageGetItemId(), PageGetMaxOffsetNumber(), PageGetPageSize(), palloc(), pfree(), RelationGetRelationName, SizeOfPageHeaderData, SPLIT_DEFAULT, SPLIT_MANY_DUPLICATES, and SPLIT_SINGLE_VALUE.
Referenced by _bt_split().
Definition at line 862 of file nbtsearch.c.
1005 if (chosen == NULL && impliesNN != NULL &&
1011 chosen = ¬nullkeys[keysCount];
1032 startKeys[keysCount++] = chosen;
1041 strat_total = strat;
1053 cur->sk_attno != curattr + 1)
1059 curattr =
cur->sk_attno;
1071 switch (
cur->sk_strategy)
1129 for (
i = 0;
i < keysCount;
i++)
1154 memcpy(inskey.scankeys +
i, subkey,
sizeof(
ScanKeyData));
1170 if (
i == keysCount - 1)
1172 bool used_all_subkeys =
false;
1179 if (subkey->
sk_attno != keysCount + 1)
1186 memcpy(inskey.scankeys + keysCount, subkey,
1191 used_all_subkeys =
true;
1195 if (!used_all_subkeys)
1197 switch (strat_total)
1251 elog(
ERROR,
"missing support function %d(%u,%u) for attribute %d of index \"%s\"",
1279 switch (strat_total)
1353 elog(
ERROR,
"unrecognized strat_total: %d", (
int) strat_total);
1358 _bt_metaversion(rel, heaprel, &inskey.heapkeyspace, &inskey.allequalimage);
1359 inskey.anynullkeys =
false;
1360 inskey.nextkey = nextkey;
1361 inskey.pivotsearch =
false;
1362 inskey.scantid = NULL;
1363 inskey.keysz = keysCount;
#define RegProcedureIsValid(p)
FmgrInfo * index_getprocinfo(Relation irel, AttrNumber attnum, uint16 procnum)
void _bt_metaversion(Relation rel, Relation heaprel, bool *heapkeyspace, bool *allequalimage)
void _bt_unlockbuf(Relation rel, Buffer buf)
void _bt_parallel_done(IndexScanDesc scan)
bool _bt_parallel_seize(IndexScanDesc scan, BlockNumber *pageno)
#define BTScanPosIsValid(scanpos)
#define BTScanPosInvalidate(scanpos)
static bool _bt_readpage(IndexScanDesc scan, ScanDirection dir, OffsetNumber offnum)
static bool _bt_parallel_readpage(IndexScanDesc scan, BlockNumber blkno, ScanDirection dir)
static void _bt_drop_lock_and_maybe_pin(IndexScanDesc scan, BTScanPos sp)
static OffsetNumber _bt_binsrch(Relation rel, BTScanInsert key, Buffer buf)
static bool _bt_endpoint(IndexScanDesc scan, ScanDirection dir)
static bool _bt_steppage(IndexScanDesc scan, ScanDirection dir)
BTStack _bt_search(Relation rel, Relation heaprel, BTScanInsert key, Buffer *bufP, int access, Snapshot snapshot)
static void _bt_initialize_more_data(BTScanOpaque so, ScanDirection dir)
void _bt_preprocess_keys(IndexScanDesc scan)
#define OffsetNumberPrev(offsetNumber)
#define pgstat_count_index_scan(rel)
void PredicateLockPage(Relation relation, BlockNumber blkno, Snapshot snapshot)
void PredicateLockRelation(Relation relation, Snapshot snapshot)
void ScanKeyEntryInitialize(ScanKey entry, int flags, AttrNumber attributeNumber, StrategyNumber strategy, Oid subtype, Oid collation, RegProcedure procedure, Datum argument)
void ScanKeyEntryInitializeWithInfo(ScanKey entry, int flags, AttrNumber attributeNumber, StrategyNumber strategy, Oid subtype, Oid collation, FmgrInfo *finfo, Datum argument)
#define BTGreaterStrategyNumber
#define BTLessStrategyNumber
#define BTEqualStrategyNumber
#define BTLessEqualStrategyNumber
#define BTGreaterEqualStrategyNumber
BTScanPosItem items[MaxTIDsPerBTreePage]
ItemPointerData xs_heaptid
struct SnapshotData * xs_snapshot
StrategyNumber sk_strategy
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(), IndexScanDescData::heapRelation, 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_attno, SK_BT_DESC, SK_BT_NULLS_FIRST, ScanKeyData::sk_flags, SK_ISNULL, SK_ROW_END, SK_ROW_HEADER, SK_ROW_MEMBER, SK_SEARCHNOTNULL, ScanKeyData::sk_strategy, IndexScanDescData::xs_heaptid, IndexScanDescData::xs_itup, IndexScanDescData::xs_snapshot, and IndexScanDescData::xs_want_itup.
Referenced by btgetbitmap(), and btgettuple().
Definition at line 872 of file nbtpage.c.
953 elog(
DEBUG2,
"FSM returned nonrecyclable page");
958 elog(
DEBUG2,
"FSM returned nonlockable page");
Buffer ExtendBufferedRel(ExtendBufferedWhat eb, ForkNumber forkNum, BufferAccessStrategy strategy, uint32 flags)
void ReleaseBuffer(Buffer buffer)
Buffer ReadBuffer(Relation reln, BlockNumber blockNum)
static Size BufferGetPageSize(Buffer buffer)
BlockNumber GetFreeIndexPage(Relation rel)
static void _bt_log_reuse_page(Relation rel, Relation heaprel, BlockNumber blkno, FullTransactionId safexid)
void _bt_pageinit(Page page, Size size)
void _bt_checkpage(Relation rel, Buffer buf)
bool _bt_conditionallockbuf(Relation rel, Buffer buf)
void _bt_lockbuf(Relation rel, Buffer buf, int access)
static FullTransactionId BTPageGetDeleteXid(Page page)
static bool BTPageIsRecyclable(Page page, Relation heaprel)
References _bt_checkpage(), _bt_conditionallockbuf(), _bt_lockbuf(), _bt_log_reuse_page(), _bt_pageinit(), _bt_relbuf(), Assert(), BT_WRITE, BTPageGetDeleteXid(), BTPageIsRecyclable(), buf, BufferGetPage(), BufferGetPageSize(), DEBUG2, EB_LOCK_FIRST, EB_REL, elog(), ExtendBufferedRel(), GetFreeIndexPage(), InvalidBlockNumber, MAIN_FORKNUM, P_NEW, PageIsNew(), ReadBuffer(), RelationNeedsWAL, RelationUsesLocalBuffers, ReleaseBuffer(), VALGRIND_MAKE_MEM_DEFINED, and XLogStandbyInfoActive.
Referenced by _bt_finish_split(), _bt_getroot(), _bt_getrootheight(), _bt_getstackbuf(), _bt_gettrueroot(), _bt_insertonpg(), _bt_killitems(), _bt_leftsib_splitflag(), _bt_metaversion(), _bt_moveright(), _bt_newroot(), _bt_pagedel(), _bt_readnextpage(), _bt_rightsib_halfdeadflag(), _bt_set_cleanup_info(), _bt_split(), _bt_unlink_halfdead_page(), _bt_vacuum_needs_cleanup(), and _bt_walk_left().
Definition at line 342 of file nbtpage.c.
543 elog(
ERROR,
"no live root page found in index \"%s\"",
549 elog(
ERROR,
"root page %u of index \"%s\" has level %u, expected %u",
void * MemoryContextAlloc(MemoryContext context, Size size)
void _bt_upgrademetapage(Page page)
static BTMetaPageData * _bt_getmeta(Relation rel, Buffer metabuf)
#define BTREE_MIN_VERSION
#define SizeOfBtreeNewroot
#define XLOG_BTREE_NEWROOT
uint32 btm_last_cleanup_num_delpages
float8 btm_last_cleanup_num_heap_tuples
MemoryContext rd_indexcxt
References _bt_getbuf(), _bt_getmeta(), _bt_lockbuf(), _bt_relandgetbuf(), _bt_relbuf(), _bt_unlockbuf(), _bt_upgrademetapage(), xl_btree_metadata::allequalimage, Assert(), BT_READ, BT_WRITE, BTMetaPageData::btm_allequalimage, BTMetaPageData::btm_fastlevel, BTMetaPageData::btm_fastroot, BTMetaPageData::btm_last_cleanup_num_delpages, BTMetaPageData::btm_last_cleanup_num_heap_tuples, BTMetaPageData::btm_level, BTMetaPageData::btm_magic, BTMetaPageData::btm_root, BTMetaPageData::btm_version, BTP_LEAF, BTP_ROOT, BTPageGetOpaque, BTPageOpaqueData::btpo_cycleid, BTPageOpaqueData::btpo_flags, BTPageOpaqueData::btpo_level, BTPageOpaqueData::btpo_next, BTPageOpaqueData::btpo_prev, BTREE_MAGIC, BTREE_METAPAGE, BTREE_MIN_VERSION, BTREE_NOVAC_VERSION, BTREE_VERSION, BufferGetBlockNumber(), BufferGetPage(), elog(), END_CRIT_SECTION, ERROR, xl_btree_metadata::fastlevel, xl_btree_metadata::fastroot, InvalidBuffer, xl_btree_metadata::last_cleanup_num_delpages, xl_btree_metadata::level, xl_btree_newroot::level, MarkBufferDirty(), MemoryContextAlloc(), P_IGNORE, P_LEFTMOST, P_NEW, P_NONE, P_RIGHTMOST, PageSetLSN(), pfree(), RelationData::rd_amcache, RelationData::rd_indexcxt, REGBUF_STANDARD, REGBUF_WILL_INIT, RelationGetRelationName, RelationNeedsWAL, xl_btree_metadata::root, xl_btree_newroot::rootblk, SizeOfBtreeNewroot, START_CRIT_SECTION, xl_btree_metadata::version, XLOG_BTREE_NEWROOT, XLogBeginInsert(), XLogInsert(), XLogRegisterBufData(), XLogRegisterBuffer(), and XLogRegisterData().
Referenced by _bt_get_endpoint(), and _bt_search().