Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
166b61a8
Commit
166b61a8
authored
Nov 18, 2015
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid aggregating worker instrumentation multiple times.
Amit Kapila, per design ideas from me.
parent
adeee974
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
src/backend/executor/execParallel.c
src/backend/executor/execParallel.c
+13
-5
src/backend/executor/nodeGather.c
src/backend/executor/nodeGather.c
+1
-5
src/include/executor/execParallel.h
src/include/executor/execParallel.h
+2
-1
No files found.
src/backend/executor/execParallel.c
View file @
166b61a8
...
...
@@ -277,13 +277,15 @@ ExecParallelSetupTupleQueues(ParallelContext *pcxt, bool reinitialize)
}
/*
* Re-initialize the
response queues for backend workers to return tuples
*
to the main backend and start the
workers.
* Re-initialize the
parallel executor info such that it can be reused by
* workers.
*/
shm_mq_handle
**
ExecParallelReinitialize
TupleQueues
(
ParallelContext
*
pcxt
)
void
ExecParallelReinitialize
(
ParallelExecutorInfo
*
pei
)
{
return
ExecParallelSetupTupleQueues
(
pcxt
,
true
);
ReinitializeParallelDSM
(
pei
->
pcxt
);
pei
->
tqueue
=
ExecParallelSetupTupleQueues
(
pei
->
pcxt
,
true
);
pei
->
finished
=
false
;
}
/*
...
...
@@ -308,6 +310,7 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers)
/* Allocate object for return value. */
pei
=
palloc0
(
sizeof
(
ParallelExecutorInfo
));
pei
->
finished
=
false
;
pei
->
planstate
=
planstate
;
/* Fix up and serialize plan to be sent to workers. */
...
...
@@ -469,6 +472,9 @@ ExecParallelFinish(ParallelExecutorInfo *pei)
{
int
i
;
if
(
pei
->
finished
)
return
;
/* First, wait for the workers to finish. */
WaitForParallelWorkersToFinish
(
pei
->
pcxt
);
...
...
@@ -480,6 +486,8 @@ ExecParallelFinish(ParallelExecutorInfo *pei)
if
(
pei
->
instrumentation
)
ExecParallelRetrieveInstrumentation
(
pei
->
planstate
,
pei
->
instrumentation
);
pei
->
finished
=
true
;
}
/*
...
...
src/backend/executor/nodeGather.c
View file @
166b61a8
...
...
@@ -456,11 +456,7 @@ ExecReScanGather(GatherState *node)
node
->
initialized
=
false
;
if
(
node
->
pei
)
{
ReinitializeParallelDSM
(
node
->
pei
->
pcxt
);
node
->
pei
->
tqueue
=
ExecParallelReinitializeTupleQueues
(
node
->
pei
->
pcxt
);
}
ExecParallelReinitialize
(
node
->
pei
);
ExecReScan
(
node
->
ps
.
lefttree
);
}
src/include/executor/execParallel.h
View file @
166b61a8
...
...
@@ -27,12 +27,13 @@ typedef struct ParallelExecutorInfo
BufferUsage
*
buffer_usage
;
SharedExecutorInstrumentation
*
instrumentation
;
shm_mq_handle
**
tqueue
;
bool
finished
;
}
ParallelExecutorInfo
;
extern
ParallelExecutorInfo
*
ExecInitParallelPlan
(
PlanState
*
planstate
,
EState
*
estate
,
int
nworkers
);
extern
void
ExecParallelFinish
(
ParallelExecutorInfo
*
pei
);
extern
void
ExecParallelCleanup
(
ParallelExecutorInfo
*
pei
);
extern
shm_mq_handle
**
ExecParallelReinitializeTupleQueues
(
ParallelContext
*
pcxt
);
extern
void
ExecParallelReinitialize
(
ParallelExecutorInfo
*
pei
);
#endif
/* EXECPARALLEL_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment