PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/relscan.h"
#include "access/tableam.h"
#include "access/tupdesc.h"
#include "access/visibilitymap.h"
#include "catalog/pg_type.h"
#include "executor/executor.h"
#include "executor/nodeIndexonlyscan.h"
#include "executor/nodeIndexscan.h"
#include "miscadmin.h"
#include "storage/bufmgr.h"
#include "storage/predicate.h"
#include "utils/builtins.h"
#include "utils/rel.h"
Go to the source code of this file.
Functions | |
static TupleTableSlot * | IndexOnlyNext (IndexOnlyScanState *node) |
static void | StoreIndexTuple (IndexOnlyScanState *node, TupleTableSlot *slot, IndexTuple itup, TupleDesc itupdesc) |
static bool | IndexOnlyRecheck (IndexOnlyScanState *node, TupleTableSlot *slot) |
static TupleTableSlot * | ExecIndexOnlyScan (PlanState *pstate) |
void | ExecReScanIndexOnlyScan (IndexOnlyScanState *node) |
void | ExecEndIndexOnlyScan (IndexOnlyScanState *node) |
void | ExecIndexOnlyMarkPos (IndexOnlyScanState *node) |
void | ExecIndexOnlyRestrPos (IndexOnlyScanState *node) |
IndexOnlyScanState * | ExecInitIndexOnlyScan (IndexOnlyScan *node, EState *estate, int eflags) |
void | ExecIndexOnlyScanEstimate (IndexOnlyScanState *node, ParallelContext *pcxt) |
void | ExecIndexOnlyScanInitializeDSM (IndexOnlyScanState *node, ParallelContext *pcxt) |
void | ExecIndexOnlyScanReInitializeDSM (IndexOnlyScanState *node, ParallelContext *pcxt) |
void | ExecIndexOnlyScanInitializeWorker (IndexOnlyScanState *node, ParallelWorkerContext *pwcxt) |
void ExecEndIndexOnlyScan | ( | IndexOnlyScanState * | node | ) |
Definition at line 398 of file nodeIndexonlyscan.c.
References index_close(), index_endscan(), InvalidBuffer, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_VMBuffer, NoLock, and ReleaseBuffer().
Referenced by ExecEndNode().
void ExecIndexOnlyMarkPos | ( | IndexOnlyScanState * | node | ) |
Definition at line 433 of file nodeIndexonlyscan.c.
References Assert, elog, ERROR, EState::es_epq_active, index_markpos(), IndexOnlyScanState::ioss_ScanDesc, PlanState::plan, ScanState::ps, EPQState::relsubs_done, EPQState::relsubs_rowmark, EPQState::relsubs_slot, IndexOnlyScanState::ss, and PlanState::state.
Referenced by ExecMarkPos().
void ExecIndexOnlyRestrPos | ( | IndexOnlyScanState * | node | ) |
Definition at line 470 of file nodeIndexonlyscan.c.
References Assert, elog, ERROR, EState::es_epq_active, index_restrpos(), IndexOnlyScanState::ioss_ScanDesc, PlanState::plan, ScanState::ps, EPQState::relsubs_done, EPQState::relsubs_rowmark, EPQState::relsubs_slot, IndexOnlyScanState::ss, and PlanState::state.
Referenced by ExecRestrPos().
|
static |
Definition at line 336 of file nodeIndexonlyscan.c.
References castNode, ExecReScan(), ExecScan(), IndexOnlyNext(), IndexOnlyRecheck(), IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_RuntimeKeysReady, and IndexOnlyScanState::ss.
Referenced by ExecInitIndexOnlyScan().
void ExecIndexOnlyScanEstimate | ( | IndexOnlyScanState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 706 of file nodeIndexonlyscan.c.
References EState::es_snapshot, ParallelContext::estimator, index_parallelscan_estimate(), IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_PscanLen, IndexOnlyScanState::ioss_RelationDesc, ScanState::ps, shm_toc_estimate_chunk, shm_toc_estimate_keys, IndexOnlyScanState::ss, and PlanState::state.
Referenced by ExecParallelEstimate().
void ExecIndexOnlyScanInitializeDSM | ( | IndexOnlyScanState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 726 of file nodeIndexonlyscan.c.
References EState::es_snapshot, index_beginscan_parallel(), index_parallelscan_initialize(), index_rescan(), InvalidBuffer, IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_PscanLen, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_ScanKeys, IndexOnlyScanState::ioss_VMBuffer, PlanState::plan, Plan::plan_node_id, ScanState::ps, shm_toc_allocate(), shm_toc_insert(), IndexOnlyScanState::ss, ScanState::ss_currentRelation, PlanState::state, ParallelContext::toc, and IndexScanDescData::xs_want_itup.
Referenced by ExecParallelInitializeDSM().
void ExecIndexOnlyScanInitializeWorker | ( | IndexOnlyScanState * | node, |
ParallelWorkerContext * | pwcxt | ||
) |
Definition at line 777 of file nodeIndexonlyscan.c.
References index_beginscan_parallel(), index_rescan(), IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_ScanKeys, PlanState::plan, Plan::plan_node_id, ScanState::ps, shm_toc_lookup(), IndexOnlyScanState::ss, ScanState::ss_currentRelation, ParallelWorkerContext::toc, and IndexScanDescData::xs_want_itup.
Referenced by ExecParallelInitializeWorker().
void ExecIndexOnlyScanReInitializeDSM | ( | IndexOnlyScanState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 764 of file nodeIndexonlyscan.c.
References index_parallelrescan(), and IndexOnlyScanState::ioss_ScanDesc.
Referenced by ExecParallelReInitializeDSM().
IndexOnlyScanState * ExecInitIndexOnlyScan | ( | IndexOnlyScan * | node, |
EState * | estate, | ||
int | eflags | ||
) |
Definition at line 506 of file nodeIndexonlyscan.c.
References attnum, EState::es_tupleTable, EXEC_FLAG_EXPLAIN_ONLY, exec_rt_fetch(), ExecAllocTableSlot(), ExecAssignExprContext(), ExecAssignScanProjectionInfoWithVarno(), ExecIndexBuildScanKeys(), ExecIndexOnlyScan(), ExecInitQual(), ExecInitResultTypeTL(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), PlanState::ExecProcNode, ExecTypeFromTL(), idx(), index_open(), INDEX_VAR, IndexOnlyScan::indexid, IndexOnlyScan::indexorderby, IndexOnlyScan::indexqual, IndexOnlyScan::indextlist, IndexOnlyScanState::ioss_NameCStringAttNums, IndexOnlyScanState::ioss_NameCStringCount, IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_RuntimeContext, IndexOnlyScanState::ioss_RuntimeKeys, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanKeys, IndexOnlyScanState::ioss_TableSlot, makeNode, palloc(), PlanState::plan, ScanState::ps, PlanState::ps_ExprContext, PlanState::qual, RelationData::rd_att, RelationData::rd_index, RelationData::rd_opcintype, IndexOnlyScanState::recheckqual, IndexOnlyScan::recheckqual, RelationGetDescr, IndexOnlyScan::scan, Scan::scanrelid, IndexOnlyScanState::ss, ScanState::ss_currentRelation, ScanState::ss_currentScanDesc, PlanState::state, table_slot_callbacks(), TTSOpsVirtual, and TupleDescAttr().
Referenced by ExecInitNode().
void ExecReScanIndexOnlyScan | ( | IndexOnlyScanState * | node | ) |
Definition at line 363 of file nodeIndexonlyscan.c.
References ExecIndexEvalRuntimeKeys(), ExecScanReScan(), index_rescan(), IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_RuntimeContext, IndexOnlyScanState::ioss_RuntimeKeys, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_ScanKeys, ResetExprContext, and IndexOnlyScanState::ss.
Referenced by ExecReScan().
|
static |
Definition at line 61 of file nodeIndexonlyscan.c.
References Assert, CHECK_FOR_INTERRUPTS, ExprContext::ecxt_scantuple, elog, ereport, errcode(), errmsg(), ERROR, EState::es_direction, EState::es_snapshot, ExecClearTuple(), ExecForceStoreHeapTuple(), ExecQualAndReset(), IndexScanDescData::heapRelation, index_beginscan(), index_fetch_heap(), index_getnext_tid(), index_rescan(), InstrCountFiltered2, InstrCountTuples2, InvalidBuffer, IndexOnlyScanState::ioss_NumOrderByKeys, IndexOnlyScanState::ioss_NumRuntimeKeys, IndexOnlyScanState::ioss_NumScanKeys, IndexOnlyScanState::ioss_OrderByKeys, IndexOnlyScanState::ioss_RelationDesc, IndexOnlyScanState::ioss_RuntimeKeysReady, IndexOnlyScanState::ioss_ScanDesc, IndexOnlyScanState::ioss_ScanKeys, IndexOnlyScanState::ioss_TableSlot, IndexOnlyScanState::ioss_VMBuffer, ItemPointerGetBlockNumber(), TupleDescData::natts, IndexScanDescData::numberOfOrderBys, PlanState::plan, PredicateLockPage(), ScanState::ps, PlanState::ps_ExprContext, IndexOnlyScanState::recheckqual, ScanDirectionCombine, IndexOnlyScanState::ss, ScanState::ss_currentRelation, ScanState::ss_ScanTupleSlot, PlanState::state, StoreIndexTuple(), TupleTableSlot::tts_tupleDescriptor, VM_ALL_VISIBLE, IndexScanDescData::xs_heap_continue, IndexScanDescData::xs_hitup, IndexScanDescData::xs_hitupdesc, IndexScanDescData::xs_itup, IndexScanDescData::xs_itupdesc, IndexScanDescData::xs_recheck, IndexScanDescData::xs_recheckorderby, and IndexScanDescData::xs_want_itup.
Referenced by ExecIndexOnlyScan().
|
static |
Definition at line 325 of file nodeIndexonlyscan.c.
Referenced by ExecIndexOnlyScan().
|
static |
Definition at line 268 of file nodeIndexonlyscan.c.
References Assert, attnum, DatumGetCString(), ExprContext::ecxt_per_tuple_memory, ExecClearTuple(), ExecStoreVirtualTuple(), idx(), index_deform_tuple(), IndexOnlyScanState::ioss_NameCStringAttNums, IndexOnlyScanState::ioss_NameCStringCount, MemoryContextAlloc(), name, NAMEDATALEN, NameGetDatum(), namestrcpy(), TupleDescData::natts, ScanState::ps, PlanState::ps_ExprContext, IndexOnlyScanState::ss, TupleTableSlot::tts_isnull, TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, and unlikely.
Referenced by IndexOnlyNext().