|
static void | BTPageSetDeleted (Page page, FullTransactionId safexid) |
|
static FullTransactionId | BTPageGetDeleteXid (Page page) |
|
static bool | BTPageIsRecyclable (Page page) |
|
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, Relation heapRel, 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, Buffer lbuf, BTStack stack) |
|
Buffer | _bt_getstackbuf (Relation rel, 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) |
|
void | _bt_set_cleanup_info (Relation rel, BlockNumber num_delpages) |
|
void | _bt_upgrademetapage (Page page) |
|
Buffer | _bt_getroot (Relation rel, int access) |
|
Buffer | _bt_gettrueroot (Relation rel) |
|
int | _bt_getrootheight (Relation rel) |
|
void | _bt_metaversion (Relation rel, bool *heapkeyspace, bool *allequalimage) |
|
void | _bt_checkpage (Relation rel, Buffer buf) |
|
Buffer | _bt_getbuf (Relation rel, 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, BTScanInsert key, Buffer *bufP, int access, Snapshot snapshot) |
|
Buffer | _bt_moveright (Relation rel, 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, uint32 level, bool rightmost, Snapshot snapshot) |
|
BTScanInsert | _bt_mkscankey (Relation rel, 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 656 of file nbtsearch.c.
696 ncmpkey =
Min(ntupatts,
key->keysz);
699 scankey =
key->scankeys;
700 for (
int i = 1;
i <= ncmpkey;
i++)
758 if (
key->keysz > ntupatts)
767 if (
key->scantid == NULL)
802 if (
key->heapkeyspace && !
key->pivotsearch &&
803 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)
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 &&
189 if (
state->nmaxitems == 5)
191 else if (
state->nmaxitems == 6)
193 state->deduplicate =
false;
194 singlevalstrat =
false;
216 if (
state->nintervals == 0)
void MarkBufferDirty(Buffer buffer)
void PageRestoreTempPage(Page tempPage, Page oldPage)
Page PageGetTempPageCopySpecial(Page page)
#define PageSetLSN(page, lsn)
#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)
XLogRecPtr XLogInsert(RmgrId rmid, uint8 info)
void XLogRegisterBufData(uint8 block_id, char *data, int len)
void XLogRegisterBuffer(uint8 block_id, Buffer buffer, uint8 flags)
void XLogBeginInsert(void)
void XLogRegisterData(char *data, int len)
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 1528 of file nbtpage.c.
1578 if (idxoffnum == postingidxoffnum)
1597 deletable[ndeletable++] = idxoffnum;
1609 postingidxoffnum = idxoffnum;
1613 for (
int p = 0; p < nitem; p++)
1624 for (; nestedi < delstate->
ndeltids; nestedi++)
1652 if (vacposting == NULL)
1656 vacposting->
itup = itup;
1665 if (vacposting == NULL)
1672 deletable[ndeletable++] = idxoffnum;
1681 updatable[nupdatable++] = vacposting;
1687 updatable, nupdatable);
1690 for (
int i = 0;
i < nupdatable;
i++)
#define offsetof(type, field)
bool ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2)
#define MaxIndexTuplesPerPage
static void _bt_delitems_delete(Relation rel, Buffer buf, TransactionId latestRemovedXid, OffsetNumber *deletable, int ndeletable, BTVacuumPosting *updatable, int nupdatable)
static int _bt_delitems_cmp(const void *a, const void *b)
static ItemPointer BTreeTupleGetPostingN(IndexTuple posting, int n)
#define OffsetNumberIsValid(offsetNumber)
#define qsort(a, b, c, d)
uint16 deletetids[FLEXIBLE_ARRAY_MEMBER]
OffsetNumber updatedoffset
static TransactionId table_index_delete_tuples(Relation rel, TM_IndexDeleteOp *delstate)
#define InvalidTransactionId
#define XLogStandbyInfoActive()
References _bt_delitems_cmp(), _bt_delitems_delete(), Assert(), TM_IndexDeleteOp::bottomup, BTreeTupleGetHeapTID(), BTreeTupleGetMaxHeapTID(), BTreeTupleGetNPosting(), BTreeTupleGetPostingN(), BTreeTupleIsPosting(), buf, 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().
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 860 of file nbtsearch.c.
1002 if (chosen == NULL && impliesNN != NULL &&
1008 chosen = ¬nullkeys[keysCount];
1029 startKeys[keysCount++] = chosen;
1038 strat_total = strat;
1050 cur->sk_attno != curattr + 1)
1056 curattr =
cur->sk_attno;
1068 switch (
cur->sk_strategy)
1126 for (
i = 0;
i < keysCount;
i++)
1151 memcpy(inskey.scankeys +
i, subkey,
sizeof(
ScanKeyData));
1167 if (
i == keysCount - 1)
1169 bool used_all_subkeys =
false;
1176 if (subkey->
sk_attno != keysCount + 1)
1183 memcpy(inskey.scankeys + keysCount, subkey,
1188 used_all_subkeys =
true;
1192 if (!used_all_subkeys)
1194 switch (strat_total)
1248 elog(
ERROR,
"missing support function %d(%u,%u) for attribute %d of index \"%s\"",
1276 switch (strat_total)
1350 elog(
ERROR,
"unrecognized strat_total: %d", (
int) strat_total);
1356 inskey.anynullkeys =
false;
1357 inskey.nextkey = nextkey;
1358 inskey.pivotsearch =
false;
1359 inskey.scantid = NULL;
1360 inskey.keysz = keysCount;
#define RegProcedureIsValid(p)
FmgrInfo * index_getprocinfo(Relation irel, AttrNumber attnum, uint16 procnum)
void _bt_metaversion(Relation rel, 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)
static void _bt_initialize_more_data(BTScanOpaque so, ScanDirection dir)
BTStack _bt_search(Relation rel, BTScanInsert key, Buffer *bufP, int access, Snapshot snapshot)
void _bt_preprocess_keys(IndexScanDesc scan)
#define OffsetNumberPrev(offsetNumber)
static void static void status(const char *fmt,...) pg_attribute_printf(1
#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(), 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, status(), IndexScanDescData::xs_heaptid, IndexScanDescData::xs_itup, IndexScanDescData::xs_snapshot, and IndexScanDescData::xs_want_itup.
Referenced by btgetbitmap(), and btgettuple().
Definition at line 871 of file nbtpage.c.
953 elog(
DEBUG2,
"FSM returned nonrecyclable page");
958 elog(
DEBUG2,
"FSM returned nonlockable page");
void ReleaseBuffer(Buffer buffer)
Buffer ReadBuffer(Relation reln, BlockNumber blockNum)
#define BufferGetPageSize(buffer)
BlockNumber GetFreeIndexPage(Relation rel)
void LockRelationForExtension(Relation relation, LOCKMODE lockmode)
void UnlockRelationForExtension(Relation relation, LOCKMODE lockmode)
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 void _bt_log_reuse_page(Relation rel, BlockNumber blkno, FullTransactionId safexid)
static FullTransactionId BTPageGetDeleteXid(Page page)
static bool BTPageIsRecyclable(Page page)
#define RELATION_IS_LOCAL(relation)
References _bt_checkpage(), _bt_conditionallockbuf(), _bt_lockbuf(), _bt_log_reuse_page(), _bt_pageinit(), _bt_relbuf(), Assert(), BT_WRITE, BTPageGetDeleteXid(), BTPageIsRecyclable(), buf, BufferGetPage, BufferGetPageSize, DEBUG2, elog, ExclusiveLock, GetFreeIndexPage(), InvalidBlockNumber, LockRelationForExtension(), P_NEW, PageIsNew, ReadBuffer(), RELATION_IS_LOCAL, RelationNeedsWAL, ReleaseBuffer(), UnlockRelationForExtension(), 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 343 of file nbtpage.c.
544 elog(
ERROR,
"no live root page found in index \"%s\"",
550 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().