#include "postgres.h"
#include "access/htup_details.h"
#include "executor/executor.h"
#include "executor/execParallel.h"
#include "executor/nodeGatherMerge.h"
#include "executor/tqueue.h"
#include "lib/binaryheap.h"
#include "miscadmin.h"
#include "optimizer/optimizer.h"
Go to the source code of this file.
Definition at line 32 of file nodeGatherMerge.c.
Definition at line 747 of file nodeGatherMerge.c.
Definition at line 292 of file nodeGatherMerge.c.
References ExecEndNode(), ExecShutdownGatherMerge(), and outerPlanState.
Referenced by ExecEndNode().
Definition at line 184 of file nodeGatherMerge.c.
References castNode, CHECK_FOR_INTERRUPTS, ExprContext::ecxt_outertuple, EState::es_parallel_workers_launched, EState::es_parallel_workers_to_launch, EState::es_use_parallel_mode, ExecInitParallelPlan(), ExecParallelCreateReaders(), ExecParallelReinitialize(), ExecProject(), gather_merge_getnext(), GatherMergeState::initialized, GatherMerge::initParam, LaunchParallelWorkers(), GatherMergeState::need_to_scan_locally, GatherMergeState::nreaders, GatherMerge::num_workers, ParallelContext::nworkers_launched, GatherMergeState::nworkers_launched, ParallelContext::nworkers_to_launch, outerPlanState, palloc(), parallel_leader_participation, ParallelExecutorInfo::pcxt, GatherMergeState::pei, PlanState::plan, GatherMergeState::ps, PlanState::ps_ExprContext, PlanState::ps_ProjInfo, ParallelExecutorInfo::reader, GatherMergeState::reader, ResetExprContext, PlanState::state, TupIsNull, and GatherMergeState::tuples_needed.
Referenced by ExecInitGatherMerge().
Definition at line 68 of file nodeGatherMerge.c.
References SortSupportData::abbreviate, Assert(), CurrentMemoryContext, ExecAssignExprContext(), ExecConditionalAssignProjectionInfo(), ExecGatherMerge(), ExecGetResultType(), ExecInitNode(), ExecInitResultTypeTL(), PlanState::ExecProcNode, gather_merge_setup(), GatherMergeState::gm_initialized, GatherMergeState::gm_nkeys, GatherMergeState::gm_sortkeys, i, GatherMergeState::initialized, innerPlan, makeNode, GatherMerge::numCols, OUTER_VAR, PlanState::outeropsfixed, PlanState::outeropsset, outerPlan, outerPlanState, palloc0(), PlanState::plan, GatherMerge::plan, PrepareSortSupportFromOrderingOp(), GatherMergeState::ps, PlanState::ps_ProjInfo, Plan::qual, PlanState::resultopsfixed, PlanState::resultopsset, SortSupportData::ssup_attno, SortSupportData::ssup_collation, SortSupportData::ssup_cxt, SortSupportData::ssup_nulls_first, PlanState::state, GatherMergeState::tupDesc, and GatherMergeState::tuples_needed.
Referenced by ExecInitNode().
Definition at line 342 of file nodeGatherMerge.c.
References bms_add_member(), ExecReScan(), ExecShutdownGatherMergeWorkers(), gather_merge_clear_tuples(), GatherMergeState::gm_initialized, GatherMergeState::initialized, outerPlan, outerPlanState, PlanState::plan, GatherMergeState::ps, and GatherMerge::rescan_param.
Referenced by ExecReScan().
Definition at line 305 of file nodeGatherMerge.c.
References ExecParallelCleanup(), ExecShutdownGatherMergeWorkers(), and GatherMergeState::pei.
Referenced by ExecEndGatherMerge(), and ExecShutdownNode_walker().
Definition at line 324 of file nodeGatherMerge.c.
References ExecParallelFinish(), GatherMergeState::pei, pfree(), and GatherMergeState::reader.
Referenced by ExecReScanGatherMerge(), and ExecShutdownGatherMerge().
Definition at line 527 of file nodeGatherMerge.c.
References ExecClearTuple(), GatherMergeState::gm_slots, GatherMergeState::gm_tuple_buffers, i, GatherMergeState::nreaders, GMReaderTupleBuffer::nTuples, pfree(), GMReaderTupleBuffer::readCounter, and GMReaderTupleBuffer::tuple.
Referenced by ExecReScanGatherMerge(), and gather_merge_getnext().
Definition at line 548 of file nodeGatherMerge.c.
References binaryheap_empty, binaryheap_first(), binaryheap_remove_first(), binaryheap_replace_first(), DatumGetInt32(), gather_merge_clear_tuples(), gather_merge_init(), gather_merge_readnext(), GatherMergeState::gm_heap, GatherMergeState::gm_initialized, GatherMergeState::gm_slots, i, and Int32GetDatum().
Referenced by ExecGatherMerge().
Definition at line 444 of file nodeGatherMerge.c.
References Assert(), binaryheap_add_unordered(), binaryheap_build(), binaryheap_reset(), castNode, CHECK_FOR_INTERRUPTS, GMReaderTupleBuffer::done, ExecClearTuple(), gather_merge_readnext(), GatherMergeState::gm_heap, GatherMergeState::gm_initialized, GatherMergeState::gm_slots, GatherMergeState::gm_tuple_buffers, i, Int32GetDatum(), load_tuple_array(), GatherMergeState::need_to_scan_locally, GatherMergeState::nreaders, GMReaderTupleBuffer::nTuples, PlanState::plan, GatherMergeState::ps, GMReaderTupleBuffer::readCounter, and TupIsNull.
Referenced by gather_merge_getnext().
Definition at line 637 of file nodeGatherMerge.c.
References ParallelExecutorInfo::area, Assert(), GMReaderTupleBuffer::done, EState::es_query_dsa, ExecProcNode(), ExecStoreMinimalTuple(), gm_readnext_tuple(), GatherMergeState::gm_slots, GatherMergeState::gm_tuple_buffers, load_tuple_array(), GatherMergeState::need_to_scan_locally, GMReaderTupleBuffer::nTuples, outerPlan, outerPlanState, GatherMergeState::pei, GatherMergeState::ps, GMReaderTupleBuffer::readCounter, PlanState::state, TupIsNull, and GMReaderTupleBuffer::tuple.
Referenced by gather_merge_getnext(), and gather_merge_init().
Definition at line 396 of file nodeGatherMerge.c.
References binaryheap_allocate(), castNode, ExecInitExtraTupleSlot(), GatherMergeState::gm_heap, GatherMergeState::gm_slots, GatherMergeState::gm_tuple_buffers, heap_compare_slots(), i, MAX_TUPLE_STORE, GatherMerge::num_workers, palloc0(), PlanState::plan, GatherMergeState::ps, PlanState::state, TTSOpsMinimalTuple, GatherMergeState::tupDesc, and GMReaderTupleBuffer::tuple.
Referenced by ExecInitGatherMerge().
Definition at line 715 of file nodeGatherMerge.c.
References CHECK_FOR_INTERRUPTS, heap_copy_minimal_tuple(), GatherMergeState::reader, and TupleQueueReaderNext().
Referenced by gather_merge_readnext(), and load_tuple_array().
Definition at line 753 of file nodeGatherMerge.c.
References a, ApplySortComparator(), arg, Assert(), b, compare(), DatumGetInt32(), GatherMergeState::gm_nkeys, GatherMergeState::gm_slots, GatherMergeState::gm_sortkeys, INVERT_COMPARE_RESULT, s1, s2, slot_getattr(), SortSupportData::ssup_attno, and TupIsNull.
Referenced by gather_merge_setup().
Definition at line 598 of file nodeGatherMerge.c.
References GMReaderTupleBuffer::done, gm_readnext_tuple(), GatherMergeState::gm_tuple_buffers, i, MAX_TUPLE_STORE, GMReaderTupleBuffer::nTuples, GMReaderTupleBuffer::readCounter, and GMReaderTupleBuffer::tuple.
Referenced by gather_merge_init(), and gather_merge_readnext().