PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
execParallel.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------
2  * execParallel.h
3  * POSTGRES parallel execution interface
4  *
5  * Portions Copyright (c) 1996-2017, 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 */
30  dsa_area *area; /* points to DSA area in DSM */
31  bool finished; /* set true by ExecParallelFinish */
32  /* These two arrays have pcxt->nworkers_launched entries: */
33  shm_mq_handle **tqueue; /* tuple queues for worker output */
34  struct TupleQueueReader **reader; /* tuple reader/writer support */
36 
38  EState *estate, int nworkers, int64 tuples_needed);
42 extern void ExecParallelReinitialize(PlanState *planstate,
44 
45 extern void ParallelQueryMain(dsm_segment *seg, shm_toc *toc);
46 
47 #endif /* EXECPARALLEL_H */
ParallelContext * pcxt
Definition: execParallel.h:27
void ExecParallelReinitialize(PlanState *planstate, ParallelExecutorInfo *pei)
Definition: execParallel.c:642
PlanState * planstate
Definition: execParallel.h:26
void ExecParallelCreateReaders(ParallelExecutorInfo *pei)
Definition: execParallel.c:616
BufferUsage * buffer_usage
Definition: execParallel.h:28
struct TupleQueueReader ** reader
Definition: execParallel.h:34
void ExecParallelFinish(ParallelExecutorInfo *pei)
Definition: execParallel.c:774
void ExecParallelCleanup(ParallelExecutorInfo *pei)
Definition: execParallel.c:832
struct ParallelExecutorInfo ParallelExecutorInfo
Definition: dsa.c:354
shm_mq_handle ** tqueue
Definition: execParallel.h:33
void ParallelQueryMain(dsm_segment *seg, shm_toc *toc)
SharedExecutorInstrumentation * instrumentation
Definition: execParallel.h:29
ParallelExecutorInfo * ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers, int64 tuples_needed)
Definition: execParallel.c:398