|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/nbtree.h"#include "access/relscan.h"#include "access/xact.h"#include "executor/instrument_node.h"#include "miscadmin.h"#include "pgstat.h"#include "storage/predicate.h"#include "utils/lsyscache.h"#include "utils/rel.h"
Go to the source code of this file.
|
static |
Definition at line 339 of file nbtsearch.c.
References _bt_compare(), Assert, BTPageGetOpaque, buf, BufferGetPage(), fb(), OffsetNumberPrev, P_FIRSTDATAKEY, P_ISLEAF, PageGetMaxOffsetNumber(), and unlikely.
Referenced by _bt_first(), and _bt_search().
| OffsetNumber _bt_binsrch_insert | ( | Relation | rel, |
| BTInsertState | insertstate | ||
| ) |
Definition at line 470 of file nbtsearch.c.
References _bt_binsrch_posting(), _bt_compare(), Assert, BTPageGetOpaque, BufferGetBlockNumber(), BufferGetPage(), ereport, errcode(), errmsg_internal(), ERROR, fb(), InvalidOffsetNumber, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), P_FIRSTDATAKEY, P_ISLEAF, PageGetMaxOffsetNumber(), RelationGetRelationName, and unlikely.
Referenced by _bt_check_unique(), _bt_findinsertloc(), and bt_rootdescend().
|
static |
Definition at line 598 of file nbtsearch.c.
References Assert, BTreeTupleGetNPosting(), BTreeTupleGetPostingN(), BTreeTupleIsPosting(), ItemIdIsDead, ItemPointerCompare(), PageGetItem(), and PageGetItemId().
Referenced by _bt_binsrch_insert().
| int32 _bt_compare | ( | Relation | rel, |
| BTScanInsert | key, | ||
| Page | page, | ||
| OffsetNumber | offnum | ||
| ) |
Definition at line 684 of file nbtsearch.c.
References _bt_check_natts(), Assert, BTPageGetOpaque, BTreeTupleGetHeapTID(), BTreeTupleGetMaxHeapTID(), BTreeTupleGetNAtts, BTreeTupleIsPosting(), DatumGetInt32(), fb(), FunctionCall2Coll(), i, index_getattr(), IndexRelationGetNumberOfKeyAttributes, INVERT_COMPARE_RESULT, ItemPointerCompare(), Min, P_FIRSTDATAKEY, P_ISLEAF, PageGetItem(), PageGetItemId(), RelationGetDescr, SK_BT_DESC, SK_BT_NULLS_FIRST, and SK_ISNULL.
Referenced by _bt_binsrch(), _bt_binsrch_insert(), _bt_check_unique(), _bt_findinsertloc(), _bt_moveright(), _bt_search_insert(), bt_rootdescend(), bt_target_page_check(), invariant_g_offset(), invariant_l_nontarget_offset(), invariant_l_offset(), and invariant_leq_offset().
|
inlinestatic |
Definition at line 55 of file nbtsearch.c.
References _bt_relbuf(), _bt_unlockbuf(), Assert, BufferGetLSNAtomic(), fb(), InvalidBuffer, and RelationNeedsWAL.
Referenced by _bt_readfirstpage(), and _bt_readnextpage().
|
static |
Definition at line 2178 of file nbtsearch.c.
References _bt_get_endpoint(), _bt_parallel_done(), _bt_readfirstpage(), _bt_returnitem(), Assert, BTPageGetOpaque, BTScanPosIsValid, BufferGetPage(), BufferIsValid(), elog, ERROR, fb(), IndexScanDescData::indexRelation, IndexScanDescData::opaque, P_FIRSTDATAKEY, P_ISLEAF, P_RIGHTMOST, PageGetMaxOffsetNumber(), PredicateLockRelation(), ScanDirectionIsBackward, ScanDirectionIsForward, start, and IndexScanDescData::xs_snapshot.
Referenced by _bt_first().
| bool _bt_first | ( | IndexScanDesc | scan, |
| ScanDirection | dir | ||
| ) |
Definition at line 878 of file nbtsearch.c.
References _bt_binsrch(), _bt_endpoint(), _bt_freestack(), _bt_metaversion(), _bt_parallel_done(), _bt_parallel_seize(), _bt_preprocess_keys(), _bt_readfirstpage(), _bt_readnextpage(), _bt_returnitem(), _bt_search(), _bt_start_array_keys(), BTScanInsertData::allequalimage, BTScanInsertData::anynullkeys, Assert, BTScanInsertData::backward, BT_READ, BTEqualStrategyNumber, BTGreaterEqualStrategyNumber, BTGreaterStrategyNumber, BTLessEqualStrategyNumber, BTLessStrategyNumber, BTORDER_PROC, BTScanPosIsValid, BufferIsValid(), cur, DatumGetPointer(), elog, ERROR, fb(), get_opfamily_proc(), BTScanInsertData::heapkeyspace, BTArrayKeyInfo::high_compare, i, index_getprocinfo(), INDEX_MAX_KEYS, IndexScanDescData::indexRelation, IndexScanDescData::instrument, InvalidBlockNumber, InvalidOid, InvalidStrategy, IsolationIsSerializable, BTScanInsertData::keysz, BTArrayKeyInfo::low_compare, BTScanInsertData::nextkey, IndexScanInstrumentation::nsearches, BTArrayKeyInfo::null_elem, IndexScanDescData::opaque, P_NONE, IndexScanDescData::parallel_scan, pgstat_count_index_scan, PredicateLockRelation(), RelationData::rd_opcintype, RelationData::rd_opfamily, RegProcedureIsValid, RelationGetRelationName, BTArrayKeyInfo::scan_key, ScanDirectionIsBackward, ScanDirectionIsForward, ScanKeyEntryInitialize(), ScanKeyEntryInitializeWithInfo(), BTScanInsertData::scankeys, BTScanInsertData::scantid, SK_BT_DESC, SK_BT_MAXVAL, SK_BT_MINVAL, SK_BT_NEXT, SK_BT_NULLS_FIRST, SK_BT_PRIOR, SK_BT_REQBKWD, SK_BT_REQFWD, SK_BT_SKIP, ScanKeyData::sk_flags, SK_ISNULL, SK_ROW_END, SK_ROW_HEADER, SK_ROW_MEMBER, SK_SEARCHNOTNULL, and IndexScanDescData::xs_snapshot.
Referenced by btgetbitmap(), and btgettuple().
Definition at line 2092 of file nbtsearch.c.
References _bt_getroot(), _bt_gettrueroot(), _bt_relandgetbuf(), BT_READ, BTPageGetOpaque, BTPageOpaqueData::btpo_level, BTPageOpaqueData::btpo_next, BTreeTupleGetDownLink(), buf, BufferGetPage(), BufferIsValid(), elog, ereport, errcode(), errmsg_internal(), ERROR, fb(), InvalidBuffer, P_FIRSTDATAKEY, P_IGNORE, P_NONE, P_RIGHTMOST, PageGetItem(), PageGetItemId(), PageGetMaxOffsetNumber(), PANIC, and RelationGetRelationName.
Referenced by _bt_endpoint(), and _bt_insert_parent().
|
static |
Definition at line 1975 of file nbtsearch.c.
References _bt_getbuf(), _bt_relandgetbuf(), _bt_relbuf(), BT_READ, BTPageGetOpaque, BTPageOpaqueData::btpo_next, BTPageOpaqueData::btpo_prev, buf, BufferGetPage(), CHECK_FOR_INTERRUPTS, elog, ERROR, fb(), InvalidBuffer, likely, P_ISDELETED, P_LEFTMOST, P_RIGHTMOST, and RelationGetRelationName.
Referenced by _bt_readnextpage().
|
static |
Definition at line 237 of file nbtsearch.c.
References _bt_compare(), _bt_finish_split(), _bt_getbuf(), _bt_lockbuf(), _bt_relandgetbuf(), _bt_relbuf(), _bt_unlockbuf(), Assert, BT_READ, BT_WRITE, BTPageGetOpaque, BTPageOpaqueData::btpo_next, buf, BufferGetBlockNumber(), BufferGetPage(), elog, ERROR, fb(), P_HIKEY, P_IGNORE, P_INCOMPLETE_SPLIT, P_RIGHTMOST, and RelationGetRelationName.
Referenced by _bt_search().
| bool _bt_next | ( | IndexScanDesc | scan, |
| ScanDirection | dir | ||
| ) |
Definition at line 1586 of file nbtsearch.c.
References _bt_returnitem(), _bt_steppage(), Assert, BTScanPosIsValid, fb(), IndexScanDescData::opaque, and ScanDirectionIsForward.
Referenced by btgetbitmap(), and btgettuple().
|
static |
Definition at line 1747 of file nbtsearch.c.
References _bt_drop_lock_and_maybe_pin(), _bt_readpage(), _bt_steppage(), _bt_unlockbuf(), Assert, BTScanPosIsPinned, fb(), IndexScanDescData::indexRelation, IndexScanDescData::opaque, and ScanDirectionIsForward.
Referenced by _bt_endpoint(), and _bt_first().
|
static |
Definition at line 1840 of file nbtsearch.c.
References _bt_drop_lock_and_maybe_pin(), _bt_getbuf(), _bt_lock_and_validate_left(), _bt_parallel_done(), _bt_parallel_release(), _bt_parallel_seize(), _bt_readpage(), _bt_relbuf(), Assert, BT_READ, BTPageGetOpaque, BTPageOpaqueData::btpo_next, BTPageOpaqueData::btpo_prev, BTScanPosInvalidate, BTScanPosIsPinned, BufferGetPage(), CHECK_FOR_INTERRUPTS, fb(), IndexScanDescData::indexRelation, InvalidBuffer, likely, IndexScanDescData::opaque, P_FIRSTDATAKEY, P_IGNORE, P_NONE, PageGetMaxOffsetNumber(), IndexScanDescData::parallel_scan, and ScanDirectionIsForward.
Referenced by _bt_first(), and _bt_steppage().
|
inlinestatic |
Definition at line 1622 of file nbtsearch.c.
References Assert, BTScanPosIsValid, fb(), IndexScanDescData::xs_heaptid, and IndexScanDescData::xs_itup.
Referenced by _bt_endpoint(), _bt_first(), and _bt_next().
Definition at line 98 of file nbtsearch.c.
References _bt_binsrch(), _bt_getroot(), _bt_lockbuf(), _bt_moveright(), _bt_relandgetbuf(), _bt_unlockbuf(), Assert, BT_READ, BT_WRITE, BTPageGetOpaque, BTPageOpaqueData::btpo_level, BTreeTupleGetDownLink(), BTreeTupleIsPivot(), BufferGetBlockNumber(), BufferGetPage(), BufferIsValid(), fb(), P_ISLEAF, PageGetItem(), PageGetItemId(), and palloc_object.
Referenced by _bt_first(), _bt_pagedel(), _bt_search_insert(), and bt_rootdescend().
|
static |
Definition at line 1647 of file nbtsearch.c.
References _bt_killitems(), _bt_readnextpage(), Assert, BTScanPosIsPinned, BTScanPosIsValid, BTScanPosUnpinIfPinned, fb(), IncrBufferRefCount(), items, IndexScanDescData::opaque, IndexScanDescData::parallel_scan, and ScanDirectionIsForward.
Referenced by _bt_next(), and _bt_readfirstpage().