PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/relscan.h"
#include "access/tableam.h"
#include "access/xact.h"
#include "catalog/index.h"
#include "executor/executor.h"
#include "nodes/nodeFuncs.h"
#include "storage/lmgr.h"
#include "utils/snapmgr.h"
Go to the source code of this file.
Enumerations | |
enum | CEOUC_WAIT_MODE { CEOUC_WAIT, CEOUC_NOWAIT, CEOUC_LIVELOCK_PREVENTING_WAIT } |
enum CEOUC_WAIT_MODE |
Enumerator | |
---|---|
CEOUC_WAIT | |
CEOUC_NOWAIT | |
CEOUC_LIVELOCK_PREVENTING_WAIT |
Definition at line 120 of file execIndexing.c.
void check_exclusion_constraint | ( | Relation | heap, |
Relation | index, | ||
IndexInfo * | indexInfo, | ||
ItemPointer | tupleid, | ||
Datum * | values, | ||
bool * | isnull, | ||
EState * | estate, | ||
bool | newIndex | ||
) |
Definition at line 887 of file execIndexing.c.
References CEOUC_WAIT, and check_exclusion_or_unique_constraint().
Referenced by exec_rt_fetch(), IndexCheckExclusion(), and unique_key_recheck().
|
static |
Definition at line 667 of file execIndexing.c.
References BuildIndexValueDescription(), CEOUC_LIVELOCK_PREVENTING_WAIT, CEOUC_WAIT, ExprContext::ecxt_scantuple, elog, ereport, errcode(), errdetail(), errmsg(), ERROR, errtableconstraint(), ExecDropSingleTupleTableSlot(), FormIndexDatum(), ForwardScanDirection, GetCurrentTransactionId(), GetPerTupleExprContext, i, IndexInfo::ii_ExclusionOps, IndexInfo::ii_ExclusionProcs, IndexInfo::ii_ExclusionStrats, IndexInfo::ii_UniqueProcs, IndexInfo::ii_UniqueStrats, index_beginscan(), index_endscan(), index_getnext_slot(), INDEX_MAX_KEYS, index_recheck_constraint(), index_rescan(), IndexRelationGetNumberOfKeyAttributes, InitDirtySnapshot, InvalidOid, ItemPointerEquals(), ItemPointerIsValid, RelationData::rd_indcollation, RelationGetRelationName, ScanKeyEntryInitialize(), SpeculativeInsertionWait(), SnapshotData::speculativeToken, table_slot_create(), TransactionIdIsValid, TransactionIdPrecedes(), TupleTableSlot::tts_tid, XactLockTableWait(), XLTW_InsertIndex, XLTW_RecheckExclusionConstr, SnapshotData::xmax, SnapshotData::xmin, and IndexScanDescData::xs_recheck.
Referenced by check_exclusion_constraint(), ExecCheckIndexConstraints(), and ExecInsertIndexTuples().
bool ExecCheckIndexConstraints | ( | ResultRelInfo * | resultRelInfo, |
TupleTableSlot * | slot, | ||
EState * | estate, | ||
ItemPointer | conflictTid, | ||
List * | arbiterIndexes | ||
) |
Definition at line 505 of file execIndexing.c.
References CEOUC_WAIT, check_exclusion_or_unique_constraint(), ExprContext::ecxt_scantuple, elog, ereport, errcode(), errmsg(), ERROR, errtableconstraint(), ExecPrepareQual(), ExecQual(), FormIndexDatum(), GetPerTupleExprContext, i, IndexInfo::ii_ExclusionOps, IndexInfo::ii_Predicate, IndexInfo::ii_PredicateState, IndexInfo::ii_ReadyForInserts, IndexInfo::ii_Unique, INDEX_MAX_KEYS, ItemPointerSetInvalid, list_member_oid(), NIL, RelationData::rd_index, RelationGetRelationName, ResultRelInfo::ri_IndexRelationDescs, ResultRelInfo::ri_IndexRelationInfo, ResultRelInfo::ri_NumIndices, ResultRelInfo::ri_RelationDesc, and values.
Referenced by exec_rt_fetch(), and ExecInsert().
void ExecCloseIndices | ( | ResultRelInfo * | resultRelInfo | ) |
Definition at line 231 of file execIndexing.c.
References i, index_close(), ResultRelInfo::ri_IndexRelationDescs, ResultRelInfo::ri_NumIndices, and RowExclusiveLock.
Referenced by apply_handle_delete_internal(), apply_handle_insert_internal(), apply_handle_tuple_routing(), apply_handle_update_internal(), CatalogCloseIndexes(), exec_rt_fetch(), ExecCleanupTupleRouting(), and ExecCloseResultRelations().
List* ExecInsertIndexTuples | ( | ResultRelInfo * | resultRelInfo, |
TupleTableSlot * | slot, | ||
EState * | estate, | ||
bool | update, | ||
bool | noDupErr, | ||
bool * | specConflict, | ||
List * | arbiterIndexes | ||
) |
Definition at line 284 of file execIndexing.c.
References Assert, CEOUC_LIVELOCK_PREVENTING_WAIT, CEOUC_NOWAIT, CEOUC_WAIT, check_exclusion_or_unique_constraint(), ExprContext::ecxt_scantuple, ExecPrepareQual(), ExecQual(), FormIndexDatum(), GetPerTupleExprContext, i, IndexInfo::ii_ExclusionOps, IndexInfo::ii_Predicate, IndexInfo::ii_PredicateState, IndexInfo::ii_ReadyForInserts, index_insert(), INDEX_MAX_KEYS, index_unchanged_by_update(), ItemPointerIsValid, lappend_oid(), list_member_oid(), NIL, RelationData::rd_index, RelationGetRelid, ResultRelInfo::ri_IndexRelationDescs, ResultRelInfo::ri_IndexRelationInfo, ResultRelInfo::ri_NumIndices, ResultRelInfo::ri_RelationDesc, TupleTableSlot::tts_tableOid, TupleTableSlot::tts_tid, UNIQUE_CHECK_NO, UNIQUE_CHECK_PARTIAL, UNIQUE_CHECK_YES, and values.
Referenced by CopyFrom(), CopyMultiInsertBufferFlush(), exec_rt_fetch(), ExecInsert(), ExecSimpleRelationInsert(), ExecSimpleRelationUpdate(), and ExecUpdate().
void ExecOpenIndices | ( | ResultRelInfo * | resultRelInfo, |
bool | speculative | ||
) |
Definition at line 156 of file execIndexing.c.
References BuildIndexInfo(), BuildSpeculativeIndexInfo(), i, IndexInfo::ii_Unique, index_open(), lfirst_oid, list_free(), list_length(), palloc(), RelationGetForm, RelationGetIndexList(), ResultRelInfo::ri_IndexRelationDescs, ResultRelInfo::ri_IndexRelationInfo, ResultRelInfo::ri_NumIndices, ResultRelInfo::ri_RelationDesc, and RowExclusiveLock.
Referenced by apply_handle_delete_internal(), apply_handle_insert_internal(), apply_handle_tuple_routing(), apply_handle_update_internal(), CatalogOpenIndexes(), CopyFrom(), exec_rt_fetch(), ExecInitModifyTable(), and ExecInitPartitionInfo().
Definition at line 1022 of file execIndexing.c.
References bms_is_member(), expression_tree_walker(), FirstLowInvalidHeapAttributeNumber, IsA, and Var::varattno.
Referenced by index_unchanged_by_update().
|
static |
Definition at line 904 of file execIndexing.c.
References DatumGetBool, i, IndexRelationGetNumberOfKeyAttributes, OidFunctionCall2Coll(), and RelationData::rd_indcollation.
Referenced by check_exclusion_or_unique_constraint().
|
static |
Definition at line 935 of file execIndexing.c.
References bms_free(), bms_is_member(), bms_union(), ExecGetExtraUpdatedCols(), ExecGetUpdatedCols(), FirstLowInvalidHeapAttributeNumber, IndexInfo::ii_IndexAttrNumbers, IndexInfo::ii_NumIndexKeyAttrs, index_expression_changed_walker(), list_free(), and RelationGetIndexExpressions().
Referenced by ExecInsertIndexTuples().