Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f02b51

Browse files
author
Amit Kapila
committed
Match the buffer usage tracking for leader and worker backends.
In the leader backend, we don't track the buffer usage for ExecutorStartphase whereas in worker backend we track it for ExecutorStart phase aswell. This leads to different value for buffer usage stats for theparallel and non-parallel query. Change the code so that worker backendalso starts tracking buffer usage after ExecutorStart.Author: Amit Kapila and Robert HaasReviewed-by: Robert Haas and Andres FreundBackpatch-through: 9.6 where this code was introducedDiscussion:https://postgr.es/m/86137f17-1dfb-42f9-7421-82fd786b04a1@anayrat.info
1 parent71e3b28 commit3f02b51

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎src/backend/executor/execParallel.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -979,9 +979,6 @@ ParallelQueryMain(dsm_segment *seg, shm_toc *toc)
979979
/* Report workers' query for monitoring purposes */
980980
pgstat_report_activity(STATE_RUNNING,debug_query_string);
981981

982-
/* Prepare to track buffer usage during query execution. */
983-
InstrStartParallelQuery();
984-
985982
/* Attach to the dynamic shared memory area. */
986983
area_space=shm_toc_lookup(toc,PARALLEL_KEY_DSA, false);
987984
area=dsa_attach_in_place(area_space,seg);
@@ -993,6 +990,15 @@ ParallelQueryMain(dsm_segment *seg, shm_toc *toc)
993990
queryDesc->planstate->state->es_query_dsa=area;
994991
ExecParallelInitializeWorker(queryDesc->planstate,toc);
995992

993+
/*
994+
* Prepare to track buffer usage during query execution.
995+
*
996+
* We do this after starting up the executor to match what happens in the
997+
* leader, which also doesn't count buffer accesses that occur during
998+
* executor startup.
999+
*/
1000+
InstrStartParallelQuery();
1001+
9961002
/* Run the plan */
9971003
ExecutorRun(queryDesc,ForwardScanDirection,0L, true);
9981004

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp