Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
166b61a8
Commit
166b61a8
authored
9 years ago
by
Robert Haas
Browse files
Options
Downloads
Patches
Plain Diff
Avoid aggregating worker instrumentation multiple times.
Amit Kapila, per design ideas from me.
parent
adeee974
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backend/executor/execParallel.c
+13
-5
13 additions, 5 deletions
src/backend/executor/execParallel.c
src/backend/executor/nodeGather.c
+1
-5
1 addition, 5 deletions
src/backend/executor/nodeGather.c
src/include/executor/execParallel.h
+2
-1
2 additions, 1 deletion
src/include/executor/execParallel.h
with
16 additions
and
11 deletions
src/backend/executor/execParallel.c
+
13
−
5
View file @
166b61a8
...
@@ -277,13 +277,15 @@ ExecParallelSetupTupleQueues(ParallelContext *pcxt, bool reinitialize)
...
@@ -277,13 +277,15 @@ ExecParallelSetupTupleQueues(ParallelContext *pcxt, bool reinitialize)
}
}
/*
/*
* Re-initialize the
response queues for backend workers to return tuples
* Re-initialize the
parallel executor info such that it can be reused by
*
to the main backend and start the
workers.
* workers.
*/
*/
shm_mq_handle
**
void
ExecParallelReinitialize
TupleQueues
(
ParallelContext
*
pcxt
)
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)
...
@@ -308,6 +310,7 @@ ExecInitParallelPlan(PlanState *planstate, EState *estate, int nworkers)
/* Allocate object for return value. */
/* Allocate object for return value. */
pei
=
palloc0
(
sizeof
(
ParallelExecutorInfo
));
pei
=
palloc0
(
sizeof
(
ParallelExecutorInfo
));
pei
->
finished
=
false
;
pei
->
planstate
=
planstate
;
pei
->
planstate
=
planstate
;
/* Fix up and serialize plan to be sent to workers. */
/* Fix up and serialize plan to be sent to workers. */
...
@@ -469,6 +472,9 @@ ExecParallelFinish(ParallelExecutorInfo *pei)
...
@@ -469,6 +472,9 @@ ExecParallelFinish(ParallelExecutorInfo *pei)
{
{
int
i
;
int
i
;
if
(
pei
->
finished
)
return
;
/* First, wait for the workers to finish. */
/* First, wait for the workers to finish. */
WaitForParallelWorkersToFinish
(
pei
->
pcxt
);
WaitForParallelWorkersToFinish
(
pei
->
pcxt
);
...
@@ -480,6 +486,8 @@ ExecParallelFinish(ParallelExecutorInfo *pei)
...
@@ -480,6 +486,8 @@ ExecParallelFinish(ParallelExecutorInfo *pei)
if
(
pei
->
instrumentation
)
if
(
pei
->
instrumentation
)
ExecParallelRetrieveInstrumentation
(
pei
->
planstate
,
ExecParallelRetrieveInstrumentation
(
pei
->
planstate
,
pei
->
instrumentation
);
pei
->
instrumentation
);
pei
->
finished
=
true
;
}
}
/*
/*
...
...
This diff is collapsed.
Click to expand it.
src/backend/executor/nodeGather.c
+
1
−
5
View file @
166b61a8
...
@@ -456,11 +456,7 @@ ExecReScanGather(GatherState *node)
...
@@ -456,11 +456,7 @@ ExecReScanGather(GatherState *node)
node
->
initialized
=
false
;
node
->
initialized
=
false
;
if
(
node
->
pei
)
if
(
node
->
pei
)
{
ExecParallelReinitialize
(
node
->
pei
);
ReinitializeParallelDSM
(
node
->
pei
->
pcxt
);
node
->
pei
->
tqueue
=
ExecParallelReinitializeTupleQueues
(
node
->
pei
->
pcxt
);
}
ExecReScan
(
node
->
ps
.
lefttree
);
ExecReScan
(
node
->
ps
.
lefttree
);
}
}
This diff is collapsed.
Click to expand it.
src/include/executor/execParallel.h
+
2
−
1
View file @
166b61a8
...
@@ -27,12 +27,13 @@ typedef struct ParallelExecutorInfo
...
@@ -27,12 +27,13 @@ typedef struct ParallelExecutorInfo
BufferUsage
*
buffer_usage
;
BufferUsage
*
buffer_usage
;
SharedExecutorInstrumentation
*
instrumentation
;
SharedExecutorInstrumentation
*
instrumentation
;
shm_mq_handle
**
tqueue
;
shm_mq_handle
**
tqueue
;
bool
finished
;
}
ParallelExecutorInfo
;
}
ParallelExecutorInfo
;
extern
ParallelExecutorInfo
*
ExecInitParallelPlan
(
PlanState
*
planstate
,
extern
ParallelExecutorInfo
*
ExecInitParallelPlan
(
PlanState
*
planstate
,
EState
*
estate
,
int
nworkers
);
EState
*
estate
,
int
nworkers
);
extern
void
ExecParallelFinish
(
ParallelExecutorInfo
*
pei
);
extern
void
ExecParallelFinish
(
ParallelExecutorInfo
*
pei
);
extern
void
ExecParallelCleanup
(
ParallelExecutorInfo
*
pei
);
extern
void
ExecParallelCleanup
(
ParallelExecutorInfo
*
pei
);
extern
shm_mq_handle
**
ExecParallelReinitialize
TupleQueues
(
ParallelContext
*
pcxt
);
extern
void
ExecParallelReinitialize
(
ParallelExecutorInfo
*
pei
);
#endif
/* EXECPARALLEL_H */
#endif
/* EXECPARALLEL_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment