PostgreSQL Source Code  git master
execParallel.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------
2  * execParallel.h
3  * POSTGRES parallel execution interface
4  *
5  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
6  * Portions Copyright (c) 1994, Regents of the University of California
7  *
8  * IDENTIFICATION
9  * src/include/executor/execParallel.h
10  *--------------------------------------------------------------------
11  */
12 
13 #ifndef EXECPARALLEL_H
14 #define EXECPARALLEL_H
15 
16 #include "access/parallel.h"
17 #include "nodes/execnodes.h"
18 #include "nodes/parsenodes.h"
19 #include "nodes/plannodes.h"
20 #include "utils/dsa.h"
21 
23 
24 typedef struct ParallelExecutorInfo
25 {
26  PlanState *planstate; /* plan subtree we're running in parallel */
27  ParallelContext *pcxt; /* parallel context we're using */
28  BufferUsage *buffer_usage; /* points to bufusage area in DSM */
29  WalUsage *wal_usage; /* walusage area in DSM */
32  dsa_area *area; /* points to DSA area in DSM */
33  dsa_pointer param_exec; /* serialized PARAM_EXEC parameters */
34  bool finished; /* set true by ExecParallelFinish */
35  /* These two arrays have pcxt->nworkers_launched entries: */
36  shm_mq_handle **tqueue; /* tuple queues for worker output */
37  struct TupleQueueReader **reader; /* tuple reader/writer support */
39 
41  EState *estate, Bitmapset *sendParams, int nworkers,
42  int64 tuples_needed);
46 extern void ExecParallelReinitialize(PlanState *planstate,
47  ParallelExecutorInfo *pei, Bitmapset *sendParams);
48 
49 extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc);
50 
51 #endif /* EXECPARALLEL_H */
uint64 dsa_pointer
Definition: dsa.h:62
void ExecParallelCleanup(ParallelExecutorInfo *pei)
struct ParallelExecutorInfo ParallelExecutorInfo
void ParallelQueryMain(dsm_segment *seg, shm_toc *toc)
ParallelExecutorInfo * ExecInitParallelPlan(PlanState *planstate, EState *estate, Bitmapset *sendParams, int nworkers, int64 tuples_needed)
Definition: execParallel.c:587
void ExecParallelReinitialize(PlanState *planstate, ParallelExecutorInfo *pei, Bitmapset *sendParams)
Definition: execParallel.c:904
void ExecParallelCreateReaders(ParallelExecutorInfo *pei)
Definition: execParallel.c:878
void ExecParallelFinish(ParallelExecutorInfo *pei)
PlanState * planstate
Definition: execParallel.h:26
struct SharedJitInstrumentation * jit_instrumentation
Definition: execParallel.h:31
BufferUsage * buffer_usage
Definition: execParallel.h:28
dsa_pointer param_exec
Definition: execParallel.h:33
ParallelContext * pcxt
Definition: execParallel.h:27
WalUsage * wal_usage
Definition: execParallel.h:29
shm_mq_handle ** tqueue
Definition: execParallel.h:36
SharedExecutorInstrumentation * instrumentation
Definition: execParallel.h:30
struct TupleQueueReader ** reader
Definition: execParallel.h:37
Definition: dsa.c:348