PostgreSQL Source Code git master
|
#include "postgres.h"
#include <math.h>
#include "access/relscan.h"
#include "access/tableam.h"
#include "access/visibilitymap.h"
#include "executor/executor.h"
#include "executor/nodeBitmapHeapscan.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "storage/bufmgr.h"
#include "utils/rel.h"
#include "utils/spccache.h"
Go to the source code of this file.
|
inlinestatic |
Definition at line 308 of file nodeBitmapHeapscan.c.
References TBMIterateResult::blockno, InvalidBlockNumber, ParallelBitmapHeapState::mutex, BitmapHeapScanState::prefetch_blockno, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::prefetch_maximum, ParallelBitmapHeapState::prefetch_pages, BitmapHeapScanState::prefetch_pages, BitmapHeapScanState::pstate, SpinLockAcquire, SpinLockRelease, tbm_exhausted(), and tbm_iterate().
Referenced by BitmapHeapNext().
|
inlinestatic |
Definition at line 384 of file nodeBitmapHeapscan.c.
References ParallelBitmapHeapState::mutex, BitmapHeapScanState::prefetch_maximum, ParallelBitmapHeapState::prefetch_target, BitmapHeapScanState::prefetch_target, BitmapHeapScanState::pstate, SpinLockAcquire, and SpinLockRelease.
Referenced by BitmapHeapNext().
|
inlinestatic |
Definition at line 292 of file nodeBitmapHeapscan.c.
References BM_FINISHED, ConditionVariableBroadcast(), ParallelBitmapHeapState::cv, ParallelBitmapHeapState::mutex, SpinLockAcquire, SpinLockRelease, and ParallelBitmapHeapState::state.
Referenced by BitmapHeapNext().
|
static |
Definition at line 67 of file nodeBitmapHeapscan.c.
References BitmapAdjustPrefetchIterator(), BitmapAdjustPrefetchTarget(), BitmapDoneInitializingSharedState(), BitmapPrefetch(), BitmapHeapScanState::bitmapqualorig, BitmapShouldInitializeSharedState(), BitmapHeapScanState::blockno, CHECK_FOR_INTERRUPTS, ExprContext::ecxt_scantuple, elog, ERROR, EState::es_query_dsa, EState::es_snapshot, BitmapHeapScanInstrumentation::exact_pages, ExecClearTuple(), ExecQualAndReset(), BitmapHeapScanState::initialized, InstrCountFiltered2, InvalidDsaPointer, IsA, BitmapHeapScanInstrumentation::lossy_pages, MultiExecProcNode(), ParallelBitmapHeapState::mutex, NIL, outerPlanState, PlanState::plan, BitmapHeapScanState::prefetch_blockno, ParallelBitmapHeapState::prefetch_iterator, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::prefetch_maximum, ParallelBitmapHeapState::prefetch_target, BitmapHeapScanState::prefetch_target, ScanState::ps, PlanState::ps_ExprContext, BitmapHeapScanState::pstate, Plan::qual, BitmapHeapScanState::recheck, TableScanDescData::rs_tbmiterator, SpinLockAcquire, SpinLockRelease, BitmapHeapScanState::ss, ScanState::ss_currentRelation, ScanState::ss_currentScanDesc, ScanState::ss_ScanTupleSlot, TableScanDescData::st, PlanState::state, BitmapHeapScanState::stats, table_beginscan_bm(), table_scan_bitmap_next_block(), table_scan_bitmap_next_tuple(), Plan::targetlist, BitmapHeapScanState::tbm, tbm_begin_iterate(), tbm_exhausted(), tbm_prepare_shared_iterate(), and ParallelBitmapHeapState::tbmiterator.
Referenced by ExecBitmapHeapScan().
|
static |
Definition at line 524 of file nodeBitmapHeapscan.c.
References BitmapHeapScanState::bitmapqualorig, ExprContext::ecxt_scantuple, ExecQualAndReset(), ScanState::ps, PlanState::ps_ExprContext, and BitmapHeapScanState::ss.
Referenced by ExecBitmapHeapScan().
|
inlinestatic |
Definition at line 423 of file nodeBitmapHeapscan.c.
References TBMIterateResult::blockno, MAIN_FORKNUM, ParallelBitmapHeapState::mutex, BitmapHeapScanState::prefetch_blockno, BitmapHeapScanState::prefetch_iterator, ParallelBitmapHeapState::prefetch_pages, BitmapHeapScanState::prefetch_pages, ParallelBitmapHeapState::prefetch_target, BitmapHeapScanState::prefetch_target, PrefetchBuffer(), BitmapHeapScanState::pstate, BitmapHeapScanState::pvmbuffer, TBMIterateResult::recheck, TableScanDescData::rs_flags, TableScanDescData::rs_rd, SO_NEED_TUPLES, SpinLockAcquire, SpinLockRelease, BitmapHeapScanState::ss, ScanState::ss_currentRelation, tbm_end_iterate(), tbm_exhausted(), tbm_iterate(), and VM_ALL_VISIBLE.
Referenced by BitmapHeapNext().
|
static |
Definition at line 781 of file nodeBitmapHeapscan.c.
References BM_INITIAL, BM_INPROGRESS, ConditionVariableCancelSleep(), ConditionVariableSleep(), ParallelBitmapHeapState::cv, ParallelBitmapHeapState::mutex, SpinLockAcquire, SpinLockRelease, and ParallelBitmapHeapState::state.
Referenced by BitmapHeapNext().
void ExecBitmapHeapEstimate | ( | BitmapHeapScanState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 814 of file nodeBitmapHeapscan.c.
References add_size(), ParallelContext::estimator, PlanState::instrument, MAXALIGN, mul_size(), ParallelContext::nworkers, ScanState::ps, shm_toc_estimate_chunk, shm_toc_estimate_keys, size, and BitmapHeapScanState::ss.
Referenced by ExecParallelEstimate().
void ExecBitmapHeapInitializeDSM | ( | BitmapHeapScanState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 839 of file nodeBitmapHeapscan.c.
References add_size(), BM_INITIAL, ConditionVariableInit(), ParallelBitmapHeapState::cv, EState::es_query_dsa, PlanState::instrument, MAXALIGN, mul_size(), ParallelBitmapHeapState::mutex, SharedBitmapHeapInstrumentation::num_workers, ParallelContext::nworkers, PlanState::plan, Plan::plan_node_id, ParallelBitmapHeapState::prefetch_iterator, ParallelBitmapHeapState::prefetch_pages, ParallelBitmapHeapState::prefetch_target, ScanState::ps, BitmapHeapScanState::pstate, shm_toc_allocate(), shm_toc_insert(), SharedBitmapHeapInstrumentation::sinstrument, BitmapHeapScanState::sinstrument, size, SpinLockInit, BitmapHeapScanState::ss, PlanState::state, ParallelBitmapHeapState::state, ParallelBitmapHeapState::tbmiterator, and ParallelContext::toc.
Referenced by ExecParallelInitializeDSM().
void ExecBitmapHeapInitializeWorker | ( | BitmapHeapScanState * | node, |
ParallelWorkerContext * | pwcxt | ||
) |
Definition at line 928 of file nodeBitmapHeapscan.c.
References Assert, EState::es_query_dsa, PlanState::instrument, MAXALIGN, PlanState::plan, Plan::plan_node_id, ScanState::ps, BitmapHeapScanState::pstate, shm_toc_lookup(), BitmapHeapScanState::sinstrument, BitmapHeapScanState::ss, PlanState::state, and ParallelWorkerContext::toc.
Referenced by ExecParallelInitializeWorker().
void ExecBitmapHeapReInitializeDSM | ( | BitmapHeapScanState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 897 of file nodeBitmapHeapscan.c.
References BM_INITIAL, DsaPointerIsValid, EState::es_query_dsa, InvalidDsaPointer, ParallelBitmapHeapState::prefetch_iterator, ParallelBitmapHeapState::prefetch_pages, ParallelBitmapHeapState::prefetch_target, ScanState::ps, BitmapHeapScanState::pstate, BitmapHeapScanState::ss, PlanState::state, ParallelBitmapHeapState::state, tbm_free_shared_area(), and ParallelBitmapHeapState::tbmiterator.
Referenced by ExecParallelReInitializeDSM().
void ExecBitmapHeapRetrieveInstrumentation | ( | BitmapHeapScanState * | node | ) |
Definition at line 951 of file nodeBitmapHeapscan.c.
References SharedBitmapHeapInstrumentation::num_workers, palloc(), BitmapHeapScanState::sinstrument, and size.
Referenced by ExecParallelRetrieveInstrumentation().
|
static |
Definition at line 543 of file nodeBitmapHeapscan.c.
References BitmapHeapNext(), BitmapHeapRecheck(), castNode, ExecScan(), and BitmapHeapScanState::ss.
Referenced by ExecInitBitmapHeapScan().
void ExecEndBitmapHeapScan | ( | BitmapHeapScanState * | node | ) |
Definition at line 610 of file nodeBitmapHeapscan.c.
References Assert, BitmapHeapScanInstrumentation::exact_pages, ExecEndNode(), InvalidBuffer, IsParallelWorker, BitmapHeapScanInstrumentation::lossy_pages, outerPlanState, ParallelWorkerNumber, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::pvmbuffer, ReleaseBuffer(), TableScanDescData::rs_tbmiterator, SharedBitmapHeapInstrumentation::sinstrument, BitmapHeapScanState::sinstrument, BitmapHeapScanState::ss, ScanState::ss_currentScanDesc, TableScanDescData::st, BitmapHeapScanState::stats, table_endscan(), BitmapHeapScanState::tbm, tbm_end_iterate(), tbm_exhausted(), and tbm_free().
Referenced by ExecEndNode().
BitmapHeapScanState * ExecInitBitmapHeapScan | ( | BitmapHeapScan * | node, |
EState * | estate, | ||
int | eflags | ||
) |
Definition at line 682 of file nodeBitmapHeapscan.c.
References Assert, BitmapHeapScanState::bitmapqualorig, BitmapHeapScan::bitmapqualorig, BitmapHeapScanState::blockno, EState::es_snapshot, EXEC_FLAG_BACKWARD, EXEC_FLAG_MARK, ExecAssignExprContext(), ExecAssignScanProjectionInfo(), ExecBitmapHeapScan(), ExecInitNode(), ExecInitQual(), ExecInitResultTypeTL(), ExecInitScanTupleSlot(), ExecOpenScanRelation(), PlanState::ExecProcNode, get_tablespace_io_concurrency(), BitmapHeapScanState::initialized, InvalidBlockNumber, InvalidBuffer, IsMVCCSnapshot, makeNode, outerPlan, outerPlanState, PlanState::plan, BitmapHeapScanState::prefetch_blockno, BitmapHeapScanState::prefetch_maximum, BitmapHeapScanState::prefetch_pages, BitmapHeapScanState::prefetch_target, ScanState::ps, BitmapHeapScanState::pstate, BitmapHeapScanState::pvmbuffer, PlanState::qual, RelationData::rd_rel, BitmapHeapScanState::recheck, RelationGetDescr, BitmapHeapScan::scan, Scan::scanrelid, BitmapHeapScanState::ss, ScanState::ss_currentRelation, PlanState::state, BitmapHeapScanState::stats, table_slot_callbacks(), and BitmapHeapScanState::tbm.
Referenced by ExecInitNode().
void ExecReScanBitmapHeapScan | ( | BitmapHeapScanState * | node | ) |
Definition at line 557 of file nodeBitmapHeapscan.c.
References BitmapHeapScanState::blockno, ExecReScan(), ExecScanReScan(), BitmapHeapScanState::initialized, InvalidBlockNumber, InvalidBuffer, outerPlan, outerPlanState, BitmapHeapScanState::prefetch_blockno, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::prefetch_pages, BitmapHeapScanState::prefetch_target, BitmapHeapScanState::pvmbuffer, BitmapHeapScanState::recheck, ReleaseBuffer(), TableScanDescData::rs_tbmiterator, BitmapHeapScanState::ss, ScanState::ss_currentScanDesc, TableScanDescData::st, table_rescan(), BitmapHeapScanState::tbm, tbm_end_iterate(), tbm_exhausted(), and tbm_free().
Referenced by ExecReScan().