32#define MAX_TUPLE_STORE 10
54 bool nowait,
bool *done);
137 gm_state->ps.resultopsfixed =
false;
155 sortKey->ssup_collation = node->collations[
i];
156 sortKey->ssup_nulls_first = node->nullsFirst[
i];
157 sortKey->ssup_attno = node->sortColIdx[
i];
363 if (
gm->rescan_param >= 0)
398 int nreaders =
gm->num_workers;
417 for (
i = 0;
i < nreaders;
i++)
455 for (
i = 0;
i < nreaders;
i++)
458 gm_state->gm_tuple_buffers[
i].nTuples = 0;
459 gm_state->gm_tuple_buffers[
i].readCounter = 0;
461 gm_state->gm_tuple_buffers[
i].done =
false;
477 for (
i = 0;
i <= nreaders;
i++)
482 if ((
i == 0) ?
gm_state->need_to_scan_locally :
504 for (
i = 1;
i <= nreaders;
i++)
506 if (!
gm_state->gm_tuple_buffers[
i - 1].done &&
663 gm_state->need_to_scan_locally =
false;
void LaunchParallelWorkers(ParallelContext *pcxt)
void binaryheap_build(binaryheap *heap)
void binaryheap_replace_first(binaryheap *heap, bh_node_type d)
void binaryheap_reset(binaryheap *heap)
bh_node_type binaryheap_first(binaryheap *heap)
bh_node_type binaryheap_remove_first(binaryheap *heap)
void binaryheap_add_unordered(binaryheap *heap, bh_node_type d)
binaryheap * binaryheap_allocate(int capacity, binaryheap_comparator compare, void *arg)
#define binaryheap_empty(h)
Bitmapset * bms_add_member(Bitmapset *a, int x)
#define INVERT_COMPARE_RESULT(var)
#define Assert(condition)
void ExecReScan(PlanState *node)
void ExecParallelCleanup(ParallelExecutorInfo *pei)
void ExecParallelReinitialize(PlanState *planstate, ParallelExecutorInfo *pei, Bitmapset *sendParams)
void ExecParallelCreateReaders(ParallelExecutorInfo *pei)
ParallelExecutorInfo * ExecInitParallelPlan(PlanState *planstate, EState *estate, Bitmapset *sendParams, int nworkers, int64 tuples_needed)
void ExecParallelFinish(ParallelExecutorInfo *pei)
void ExecEndNode(PlanState *node)
PlanState * ExecInitNode(Plan *node, EState *estate, int eflags)
void ExecInitResultTypeTL(PlanState *planstate)
TupleTableSlot * ExecStoreMinimalTuple(MinimalTuple mtup, TupleTableSlot *slot, bool shouldFree)
TupleTableSlot * ExecInitExtraTupleSlot(EState *estate, TupleDesc tupledesc, const TupleTableSlotOps *tts_ops)
const TupleTableSlotOps TTSOpsMinimalTuple
TupleDesc ExecGetResultType(PlanState *planstate)
void ExecAssignExprContext(EState *estate, PlanState *planstate)
void ExecConditionalAssignProjectionInfo(PlanState *planstate, TupleDesc inputDesc, int varno)
#define outerPlanState(node)
static TupleTableSlot * ExecProject(ProjectionInfo *projInfo)
#define ResetExprContext(econtext)
static TupleTableSlot * ExecProcNode(PlanState *node)
#define palloc0_array(type, count)
static int compare(const void *arg1, const void *arg2)
MinimalTuple heap_copy_minimal_tuple(MinimalTuple mtup, Size extra)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
#define CHECK_FOR_INTERRUPTS()
static void gather_merge_init(GatherMergeState *gm_state)
static void gather_merge_setup(GatherMergeState *gm_state)
static int32 heap_compare_slots(Datum a, Datum b, void *arg)
void ExecReScanGatherMerge(GatherMergeState *node)
static void gather_merge_clear_tuples(GatherMergeState *gm_state)
void ExecShutdownGatherMerge(GatherMergeState *node)
static void load_tuple_array(GatherMergeState *gm_state, int reader)
GatherMergeState * ExecInitGatherMerge(GatherMerge *node, EState *estate, int eflags)
static bool gather_merge_readnext(GatherMergeState *gm_state, int reader, bool nowait)
static void ExecShutdownGatherMergeWorkers(GatherMergeState *node)
static MinimalTuple gm_readnext_tuple(GatherMergeState *gm_state, int nreader, bool nowait, bool *done)
void ExecEndGatherMerge(GatherMergeState *node)
static TupleTableSlot * gather_merge_getnext(GatherMergeState *gm_state)
static TupleTableSlot * ExecGatherMerge(PlanState *pstate)
#define castNode(_type_, nodeptr)
bool parallel_leader_participation
static Datum Int32GetDatum(int32 X)
static int32 DatumGetInt32(Datum X)
void PrepareSortSupportFromOrderingOp(Oid orderingOp, SortSupport ssup)
static int ApplySortComparator(Datum datum1, bool isNull1, Datum datum2, bool isNull2, SortSupport ssup)
struct dsa_area * es_query_dsa
int es_parallel_workers_to_launch
bool es_use_parallel_mode
int es_parallel_workers_launched
TupleTableSlot * ecxt_outertuple
struct ParallelExecutorInfo * pei
struct TupleQueueReader ** reader
TupleTableSlot ** gm_slots
bool need_to_scan_locally
struct TupleQueueReader ** reader
ExprContext * ps_ExprContext
ProjectionInfo * ps_ProjInfo
MinimalTuple TupleQueueReaderNext(TupleQueueReader *reader, bool nowait, bool *done)
static Datum slot_getattr(TupleTableSlot *slot, int attnum, bool *isnull)
static TupleTableSlot * ExecClearTuple(TupleTableSlot *slot)