PostgreSQL Source Code git master
|
#include "postgres.h"
#include "executor/execAsync.h"
#include "executor/execPartition.h"
#include "executor/executor.h"
#include "executor/nodeAppend.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "storage/latch.h"
Go to the source code of this file.
Data Structures | |
struct | ParallelAppendState |
Macros | |
#define | INVALID_SUBPLAN_INDEX -1 |
#define | EVENT_BUFFER_SIZE 16 |
#define EVENT_BUFFER_SIZE 16 |
Definition at line 84 of file nodeAppend.c.
#define INVALID_SUBPLAN_INDEX -1 |
Definition at line 83 of file nodeAppend.c.
|
static |
Definition at line 634 of file nodeAppend.c.
References AppendState::as_first_partial_plan, AppendState::as_nplans, AppendState::as_prune_state, AppendState::as_pstate, AppendState::as_valid_subplans, AppendState::as_valid_subplans_identified, AppendState::as_whichplan, Assert, EState::es_direction, ExecFindMatchingSubPlans(), INVALID_SUBPLAN_INDEX, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), mark_invalid_subplans_as_finished(), ParallelAppendState::pa_finished, ParallelAppendState::pa_lock, ParallelAppendState::pa_next_plan, AppendState::ps, ScanDirectionIsForward, and PlanState::state.
Referenced by ExecAppendInitializeDSM().
|
static |
Definition at line 716 of file nodeAppend.c.
References AppendState::as_first_partial_plan, AppendState::as_nplans, AppendState::as_prune_state, AppendState::as_pstate, AppendState::as_valid_subplans, AppendState::as_valid_subplans_identified, AppendState::as_whichplan, Assert, bms_next_member(), EState::es_direction, ExecFindMatchingSubPlans(), INVALID_SUBPLAN_INDEX, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), mark_invalid_subplans_as_finished(), ParallelAppendState::pa_finished, ParallelAppendState::pa_lock, ParallelAppendState::pa_next_plan, AppendState::ps, ScanDirectionIsForward, and PlanState::state.
Referenced by ExecAppendInitializeWorker().
|
static |
Definition at line 568 of file nodeAppend.c.
References AppendState::as_nasyncplans, AppendState::as_nplans, AppendState::as_prune_state, AppendState::as_syncdone, AppendState::as_valid_subplans, AppendState::as_valid_subplans_identified, AppendState::as_whichplan, Assert, bms_next_member(), bms_prev_member(), EState::es_direction, ExecFindMatchingSubPlans(), INVALID_SUBPLAN_INDEX, AppendState::ps, ScanDirectionIsForward, and PlanState::state.
Referenced by ExecInitAppend().
|
static |
Definition at line 1165 of file nodeAppend.c.
References AppendState::as_asyncplans, AppendState::as_nasyncremain, AppendState::as_syncdone, AppendState::as_valid_asyncplans, AppendState::as_valid_subplans, AppendState::as_valid_subplans_identified, Assert, bms_del_members(), bms_intersect(), bms_is_empty, and bms_overlap().
Referenced by ExecAppendAsyncBegin(), and ExecInitAppend().
|
static |
Definition at line 302 of file nodeAppend.c.
References AppendState::appendplans, AppendState::as_begun, AppendState::as_nasyncplans, AppendState::as_nasyncremain, AppendState::as_needrequest, AppendState::as_nplans, AppendState::as_syncdone, AppendState::as_whichplan, Assert, bms_is_empty, castNode, CHECK_FOR_INTERRUPTS, AppendState::choose_next_subplan, ExecAppendAsyncBegin(), ExecAppendAsyncEventWait(), ExecAppendAsyncGetNext(), ExecClearTuple(), ExecProcNode(), INVALID_SUBPLAN_INDEX, AppendState::ps, PlanState::ps_ResultTupleSlot, and TupIsNull.
Referenced by ExecInitAppend().
|
static |
Definition at line 876 of file nodeAppend.c.
References AppendState::as_asyncrequests, AppendState::as_nasyncplans, AppendState::as_nasyncremain, AppendState::as_nplans, AppendState::as_prune_state, AppendState::as_syncdone, AppendState::as_valid_asyncplans, AppendState::as_valid_subplans, AppendState::as_valid_subplans_identified, Assert, bms_is_empty, bms_next_member(), bms_num_members(), AsyncRequest::callback_pending, classify_matching_subplans(), EState::es_direction, ExecAsyncRequest(), ExecFindMatchingSubPlans(), i, AppendState::ps, AsyncRequest::request_index, ScanDirectionIsForward, and PlanState::state.
Referenced by ExecAppend().
|
static |
Definition at line 1031 of file nodeAppend.c.
References AddWaitEventToSet(), AppendState::as_asyncplans, AppendState::as_asyncrequests, AppendState::as_eventset, AppendState::as_nasyncplans, AppendState::as_nasyncremain, AppendState::as_syncdone, Assert, bms_next_member(), AsyncRequest::callback_pending, CreateWaitEventSet(), CurrentResourceOwner, EVENT_BUFFER_SIZE, WaitEvent::events, ExecAsyncConfigureWait(), ExecAsyncNotify(), FreeWaitEventSet(), GetNumRegisteredWaitEvents(), i, if(), PGINVALID_SOCKET, WaitEvent::user_data, WaitEventSetWait(), WL_EXIT_ON_PM_DEATH, and WL_SOCKET_READABLE.
Referenced by ExecAppend(), and ExecAppendAsyncGetNext().
|
static |
Definition at line 928 of file nodeAppend.c.
References AppendState::as_nasyncremain, AppendState::as_syncdone, Assert, CHECK_FOR_INTERRUPTS, ExecAppendAsyncEventWait(), ExecAppendAsyncRequest(), ExecClearTuple(), AppendState::ps, and PlanState::ps_ResultTupleSlot.
Referenced by ExecAppend().
|
static |
Definition at line 977 of file nodeAppend.c.
References AppendState::as_asyncrequests, AppendState::as_asyncresults, AppendState::as_nasyncresults, AppendState::as_needrequest, Assert, bms_free(), bms_is_empty, bms_next_member(), ExecAsyncRequest(), and i.
Referenced by ExecAppendAsyncGetNext().
void ExecAppendEstimate | ( | AppendState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 498 of file nodeAppend.c.
References add_size(), AppendState::as_nplans, ParallelContext::estimator, AppendState::pstate_len, shm_toc_estimate_chunk, and shm_toc_estimate_keys.
Referenced by ExecParallelEstimate().
void ExecAppendInitializeDSM | ( | AppendState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 517 of file nodeAppend.c.
References AppendState::as_pstate, AppendState::choose_next_subplan, choose_next_subplan_for_leader(), LWLockInitialize(), LWTRANCHE_PARALLEL_APPEND, ParallelAppendState::pa_lock, PlanState::plan, Plan::plan_node_id, AppendState::ps, AppendState::pstate_len, shm_toc_allocate(), shm_toc_insert(), and ParallelContext::toc.
Referenced by ExecParallelInitializeDSM().
void ExecAppendInitializeWorker | ( | AppendState * | node, |
ParallelWorkerContext * | pwcxt | ||
) |
Definition at line 554 of file nodeAppend.c.
References AppendState::as_pstate, AppendState::choose_next_subplan, choose_next_subplan_for_worker(), PlanState::plan, Plan::plan_node_id, AppendState::ps, shm_toc_lookup(), and ParallelWorkerContext::toc.
Referenced by ExecParallelInitializeWorker().
void ExecAppendReInitializeDSM | ( | AppendState * | node, |
ParallelContext * | pcxt | ||
) |
Definition at line 538 of file nodeAppend.c.
References AppendState::as_nplans, AppendState::as_pstate, ParallelAppendState::pa_finished, and ParallelAppendState::pa_next_plan.
Referenced by ExecParallelReInitializeDSM().
void ExecAsyncAppendResponse | ( | AsyncRequest * | areq | ) |
Definition at line 1119 of file nodeAppend.c.
References AppendState::as_asyncresults, AppendState::as_nasyncplans, AppendState::as_nasyncremain, AppendState::as_nasyncresults, AppendState::as_needrequest, Assert, bms_add_member(), AsyncRequest::callback_pending, IsA, AsyncRequest::request_complete, AsyncRequest::request_index, AsyncRequest::requestor, AsyncRequest::result, and TupIsNull.
Referenced by ExecAsyncResponse().
void ExecEndAppend | ( | AppendState * | node | ) |
Definition at line 400 of file nodeAppend.c.
References AppendState::appendplans, AppendState::as_nplans, ExecEndNode(), and i.
Referenced by ExecEndNode().
AppendState * ExecInitAppend | ( | Append * | node, |
EState * | estate, | ||
int | eflags | ||
) |
Definition at line 109 of file nodeAppend.c.
References AppendState::appendplans, Append::appendplans, AppendState::as_asyncplans, AppendState::as_asyncrequests, AppendState::as_asyncresults, AppendState::as_begun, AppendState::as_eventset, AppendState::as_first_partial_plan, AppendState::as_nasyncplans, AppendState::as_nasyncremain, AppendState::as_nasyncresults, AppendState::as_needrequest, AppendState::as_nplans, AppendState::as_prune_state, AppendState::as_syncdone, AppendState::as_valid_asyncplans, AppendState::as_valid_subplans, AppendState::as_valid_subplans_identified, AppendState::as_whichplan, Assert, Plan::async_capable, bms_add_member(), bms_add_range(), bms_next_member(), bms_num_members(), AsyncRequest::callback_pending, AppendState::choose_next_subplan, choose_next_subplan_locally(), classify_matching_subplans(), PartitionPruneState::do_exec_prune, EState::es_epq_active, EXEC_FLAG_MARK, ExecAppend(), ExecGetCommonSlotOps(), ExecInitNode(), ExecInitPartitionPruning(), ExecInitResultTupleSlotTL(), PlanState::ExecProcNode, Append::first_partial_plan, i, INVALID_SUBPLAN_INDEX, j, list_length(), list_nth(), makeNode, palloc(), palloc0(), Append::part_prune_info, PlanState::plan, AppendState::ps, PlanState::ps_ProjInfo, AsyncRequest::request_complete, AsyncRequest::request_index, AsyncRequest::requestee, AsyncRequest::requestor, AsyncRequest::result, PlanState::resultopsfixed, PlanState::resultopsset, PlanState::state, and TTSOpsVirtual.
Referenced by ExecInitNode().
void ExecReScanAppend | ( | AppendState * | node | ) |
Definition at line 420 of file nodeAppend.c.
References AppendState::appendplans, AppendState::as_asyncplans, AppendState::as_asyncrequests, AppendState::as_begun, AppendState::as_nasyncplans, AppendState::as_nasyncremain, AppendState::as_nasyncresults, AppendState::as_needrequest, AppendState::as_nplans, AppendState::as_prune_state, AppendState::as_syncdone, AppendState::as_valid_asyncplans, AppendState::as_valid_subplans, AppendState::as_valid_subplans_identified, AppendState::as_whichplan, bms_free(), bms_next_member(), bms_overlap(), AsyncRequest::callback_pending, PlanState::chgParam, PartitionPruneState::execparamids, ExecReScan(), i, INVALID_SUBPLAN_INDEX, AppendState::ps, AsyncRequest::request_complete, AsyncRequest::result, and UpdateChangedParamSet().
Referenced by ExecReScan().
|
static |
Definition at line 842 of file nodeAppend.c.
References AppendState::as_nplans, AppendState::as_prune_state, AppendState::as_pstate, AppendState::as_valid_subplans, Assert, bms_is_member(), bms_num_members(), i, and ParallelAppendState::pa_finished.
Referenced by choose_next_subplan_for_leader(), and choose_next_subplan_for_worker().