PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/nbtree.h"
#include "access/nbtxlog.h"
#include "access/xloginsert.h"
#include "miscadmin.h"
#include "utils/rel.h"
Go to the source code of this file.
Functions | |
static void | _bt_bottomupdel_finish_pending (Page page, BTDedupState state, TM_IndexDeleteOp *delstate) |
static bool | _bt_do_singleval (Relation rel, Page page, BTDedupState state, OffsetNumber minoff, IndexTuple newitem) |
static void | _bt_singleval_fillfactor (Page page, BTDedupState state, Size newitemsz) |
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) |
|
static |
Definition at line 648 of file nbtdedup.c.
References Assert, BTreeTupleGetHeapTID(), BTreeTupleGetMaxHeapTID(), BTreeTupleGetNPosting(), BTreeTupleGetPostingN(), BTreeTupleIsPosting(), TM_IndexDeleteOp::deltids, TM_IndexStatus::freespace, i, TM_IndexDelete::id, TM_IndexStatus::idxoffnum, ItemIdGetLength, ItemPointerGetBlockNumber(), TM_IndexStatus::knowndeletable, TM_IndexDeleteOp::ndeltids, PageGetItem(), PageGetItemId(), TM_IndexStatus::promising, TM_IndexDeleteOp::status, IndexTupleData::t_tid, and TM_IndexDelete::tid.
Referenced by _bt_bottomupdel_pass().
Definition at line 307 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, TM_IndexDeleteOp::bottomup, TM_IndexDeleteOp::bottomupfreespace, BTPageGetOpaque, buf, BufferGetBlockNumber(), BufferGetPage(), TM_IndexDeleteOp::deltids, TM_IndexDeleteOp::iblknum, IndexRelationGetNumberOfKeyAttributes, InvalidOffsetNumber, TM_IndexDeleteOp::irel, ItemIdIsDead, Max, MaxTIDsPerBTreePage, TM_IndexDeleteOp::ndeltids, OffsetNumberNext, P_FIRSTDATAKEY, PageGetExactFreeSpace(), PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), palloc(), pfree(), and TM_IndexDeleteOp::status.
Referenced by _bt_delete_or_dedup_one_page().
Size _bt_dedup_finish_pending | ( | Page | newpage, |
BTDedupState | state | ||
) |
Definition at line 555 of file nbtdedup.c.
References _bt_form_posting(), Assert, BTMaxItemSize, elog, ERROR, IndexTupleSize, InvalidOffsetNumber, MAXALIGN, OffsetNumberNext, PageAddItem, PageGetMaxOffsetNumber(), and pfree().
Referenced by _bt_dedup_pass(), and btree_xlog_dedup().
void _bt_dedup_pass | ( | Relation | rel, |
Buffer | buf, | ||
IndexTuple | newitem, | ||
Size | newitemsz, | ||
bool | bottomupdedup | ||
) |
Definition at line 58 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, 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().
bool _bt_dedup_save_htid | ( | BTDedupState | state, |
IndexTuple | itup | ||
) |
Definition at line 484 of file nbtdedup.c.
References Assert, BTreeTupleGetNPosting(), BTreeTupleGetPosting(), BTreeTupleIsPivot(), BTreeTupleIsPosting(), IndexTupleSize, MAXALIGN, 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 433 of file nbtdedup.c.
References Assert, BTreeTupleGetNPosting(), BTreeTupleGetPosting(), BTreeTupleGetPostingOffset(), BTreeTupleIsPivot(), BTreeTupleIsPosting(), IndexTupleSize, MAXALIGN, and IndexTupleData::t_tid.
Referenced by _bt_bottomupdel_pass(), _bt_dedup_pass(), _bt_load(), and btree_xlog_dedup().
|
static |
Definition at line 782 of file nbtdedup.c.
References _bt_keep_natts_fast(), IndexRelationGetNumberOfKeyAttributes, PageGetItem(), PageGetItemId(), and PageGetMaxOffsetNumber().
Referenced by _bt_dedup_pass().
IndexTuple _bt_form_posting | ( | IndexTuple | base, |
ItemPointer | htids, | ||
int | nhtids | ||
) |
Definition at line 864 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().
|
static |
Definition at line 822 of file nbtdedup.c.
References BTREE_SINGLEVAL_FILLFACTOR, MAXALIGN, PageGetPageSize(), and SizeOfPageHeaderData.
Referenced by _bt_dedup_pass().
IndexTuple _bt_swap_posting | ( | IndexTuple | newitem, |
IndexTuple | oposting, | ||
int | postingoff | ||
) |
Definition at line 1022 of file nbtdedup.c.
References Assert, BTreeTupleGetHeapTID(), BTreeTupleGetMaxHeapTID(), BTreeTupleGetNPosting(), BTreeTupleGetPostingN(), BTreeTupleIsPivot(), BTreeTupleIsPosting(), CopyIndexTuple(), elog, ERROR, ItemPointerCompare(), ItemPointerCopy(), and IndexTupleData::t_tid.
Referenced by _bt_insertonpg(), btree_xlog_insert(), and btree_xlog_split().
void _bt_update_posting | ( | BTVacuumPosting | vacposting | ) |
Definition at line 924 of file nbtdedup.c.
References Assert, BTreeTupleGetNPosting(), BTreeTupleGetPosting(), BTreeTupleGetPostingN(), BTreeTupleGetPostingOffset(), BTreeTupleSetPosting(), BTVacuumPostingData::deletetids, i, INDEX_ALT_TID_MASK, INDEX_SIZE_MASK, ItemPointerIsValid(), BTVacuumPostingData::itup, MAXALIGN, BTVacuumPostingData::ndeletedtids, palloc0(), IndexTupleData::t_info, and IndexTupleData::t_tid.
Referenced by _bt_delitems_update(), and btree_xlog_updates().