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/snapmgr.h"
#include "utils/spccache.h"
Go to the source code of this file.
|
inlinestatic |
Definition at line 344 of file nodeBitmapHeapscan.c.
References TBMIterateResult::blockno, elog, ERROR, ParallelBitmapHeapState::mutex, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::prefetch_maximum, ParallelBitmapHeapState::prefetch_pages, BitmapHeapScanState::prefetch_pages, BitmapHeapScanState::pstate, BitmapHeapScanState::shared_prefetch_iterator, SpinLockAcquire, SpinLockRelease, tbm_iterate(), and tbm_shared_iterate().
Referenced by BitmapHeapNext().
|
inlinestatic |
Definition at line 409 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 332 of file nodeBitmapHeapscan.c.
References BM_FINISHED, ConditionVariableBroadcast(), ParallelBitmapHeapState::cv, ParallelBitmapHeapState::mutex, SpinLockAcquire, SpinLockRelease, and ParallelBitmapHeapState::state.
Referenced by BitmapHeapNext().
|
static |
Definition at line 69 of file nodeBitmapHeapscan.c.
References BitmapAdjustPrefetchIterator(), BitmapAdjustPrefetchTarget(), BitmapDoneInitializingSharedState(), BitmapPrefetch(), BitmapHeapScanState::bitmapqualorig, BitmapShouldInitializeSharedState(), TBMIterateResult::blockno, CHECK_FOR_INTERRUPTS, ExprContext::ecxt_scantuple, elog, ERROR, EState::es_query_dsa, EState::es_snapshot, BitmapHeapScanInstrumentation::exact_pages, ExecClearTuple(), ExecQualAndReset(), BitmapHeapScanState::initialized, InstrCountFiltered2, IsA, BitmapHeapScanInstrumentation::lossy_pages, MultiExecProcNode(), ParallelBitmapHeapState::mutex, NIL, TBMIterateResult::ntuples, outerPlanState, PlanState::plan, ParallelBitmapHeapState::prefetch_iterator, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::prefetch_maximum, ParallelBitmapHeapState::prefetch_pages, BitmapHeapScanState::prefetch_pages, ParallelBitmapHeapState::prefetch_target, BitmapHeapScanState::prefetch_target, ScanState::ps, PlanState::ps_ExprContext, BitmapHeapScanState::pstate, Plan::qual, TBMIterateResult::recheck, BitmapHeapScanState::shared_prefetch_iterator, BitmapHeapScanState::shared_tbmiterator, SpinLockAcquire, SpinLockRelease, BitmapHeapScanState::ss, ScanState::ss_currentRelation, ScanState::ss_currentScanDesc, ScanState::ss_ScanTupleSlot, PlanState::state, BitmapHeapScanState::stats, table_beginscan_bm(), table_scan_bitmap_next_block(), table_scan_bitmap_next_tuple(), Plan::targetlist, BitmapHeapScanState::tbm, tbm_attach_shared_iterate(), tbm_begin_iterate(), tbm_iterate(), tbm_prepare_shared_iterate(), tbm_shared_iterate(), ParallelBitmapHeapState::tbmiterator, BitmapHeapScanState::tbmiterator, and BitmapHeapScanState::tbmres.
Referenced by ExecBitmapHeapScan().
|
static |
Definition at line 548 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 448 of file nodeBitmapHeapscan.c.
References TBMIterateResult::blockno, MAIN_FORKNUM, ParallelBitmapHeapState::mutex, 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, BitmapHeapScanState::shared_prefetch_iterator, SO_NEED_TUPLES, SpinLockAcquire, SpinLockRelease, BitmapHeapScanState::ss, ScanState::ss_currentRelation, tbm_end_iterate(), tbm_end_shared_iterate(), tbm_iterate(), tbm_shared_iterate(), and VM_ALL_VISIBLE.
Referenced by BitmapHeapNext().
|
static |
Definition at line 795 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 828 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 853 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 940 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 911 of file nodeBitmapHeapscan.c.
References BM_INITIAL, DsaPointerIsValid, EState::es_query_dsa, InvalidDsaPointer, ParallelBitmapHeapState::prefetch_iterator, 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 963 of file nodeBitmapHeapscan.c.
References SharedBitmapHeapInstrumentation::num_workers, palloc(), BitmapHeapScanState::sinstrument, and size.
Referenced by ExecParallelRetrieveInstrumentation().
|
static |
Definition at line 567 of file nodeBitmapHeapscan.c.
References BitmapHeapNext(), BitmapHeapRecheck(), castNode, ExecScan(), and BitmapHeapScanState::ss.
Referenced by ExecInitBitmapHeapScan().
void ExecEndBitmapHeapScan | ( | BitmapHeapScanState * | node | ) |
Definition at line 626 of file nodeBitmapHeapscan.c.
References Assert, BitmapHeapScanInstrumentation::exact_pages, ExecEndNode(), InvalidBuffer, IsParallelWorker, BitmapHeapScanInstrumentation::lossy_pages, outerPlanState, ParallelWorkerNumber, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::pvmbuffer, ReleaseBuffer(), BitmapHeapScanState::shared_prefetch_iterator, BitmapHeapScanState::shared_tbmiterator, SharedBitmapHeapInstrumentation::sinstrument, BitmapHeapScanState::sinstrument, BitmapHeapScanState::ss, ScanState::ss_currentScanDesc, BitmapHeapScanState::stats, table_endscan(), BitmapHeapScanState::tbm, tbm_end_iterate(), tbm_end_shared_iterate(), tbm_free(), and BitmapHeapScanState::tbmiterator.
Referenced by ExecEndNode().
BitmapHeapScanState* ExecInitBitmapHeapScan | ( | BitmapHeapScan * | node, |
EState * | estate, | ||
int | eflags | ||
) |
Definition at line 694 of file nodeBitmapHeapscan.c.
References Assert, BitmapHeapScanState::bitmapqualorig, BitmapHeapScan::bitmapqualorig, 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, InvalidBuffer, IsMVCCSnapshot, makeNode, outerPlan, outerPlanState, PlanState::plan, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::prefetch_maximum, BitmapHeapScanState::prefetch_pages, BitmapHeapScanState::prefetch_target, ScanState::ps, BitmapHeapScanState::pstate, BitmapHeapScanState::pvmbuffer, PlanState::qual, RelationData::rd_rel, RelationGetDescr, BitmapHeapScan::scan, Scan::scanrelid, BitmapHeapScanState::shared_prefetch_iterator, BitmapHeapScanState::shared_tbmiterator, BitmapHeapScanState::ss, ScanState::ss_currentRelation, PlanState::state, BitmapHeapScanState::stats, table_slot_callbacks(), BitmapHeapScanState::tbm, BitmapHeapScanState::tbmiterator, and BitmapHeapScanState::tbmres.
Referenced by ExecInitNode().
void ExecReScanBitmapHeapScan | ( | BitmapHeapScanState * | node | ) |
Definition at line 581 of file nodeBitmapHeapscan.c.
References ExecReScan(), ExecScanReScan(), BitmapHeapScanState::initialized, InvalidBuffer, outerPlan, outerPlanState, BitmapHeapScanState::prefetch_iterator, BitmapHeapScanState::pvmbuffer, ReleaseBuffer(), BitmapHeapScanState::shared_prefetch_iterator, BitmapHeapScanState::shared_tbmiterator, BitmapHeapScanState::ss, ScanState::ss_currentScanDesc, table_rescan(), BitmapHeapScanState::tbm, tbm_end_iterate(), tbm_end_shared_iterate(), tbm_free(), BitmapHeapScanState::tbmiterator, and BitmapHeapScanState::tbmres.
Referenced by ExecReScan().