diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-10-19 13:39:38 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-10-19 13:39:38 +0900 |
commit | 295c36c0c1fa7b6befd0a3525c7f109e838c9448 (patch) | |
tree | d5367a109733fbfbefd2f17ca730b425c53cdcd6 /src/backend/executor | |
parent | 13d00729d422c84b1764c24251abcc785ea4adb1 (diff) | |
download | postgresql-295c36c0c1fa7b6befd0a3525c7f109e838c9448.tar.gz postgresql-295c36c0c1fa7b6befd0a3525c7f109e838c9448.zip |
Add local_blk_{read|write}_time I/O timing statistics for local blocks
There was no I/O timing statistics for counting read and write timings
on local blocks, contrary to the counterparts for temp and shared
blocks. This information is available when track_io_timing is enabled.
The output of EXPLAIN is updated to show this information. An update of
pg_stat_statements is planned next.
Author: Nazir Bilal Yavuz
Reviewed-by: Robert Haas, Melanie Plageman
Discussion: https://postgr.es/m/CAN55FZ19Ss279mZuqGbuUNxka0iPbLgYuOQXqAKewrjNrp27VA@mail.gmail.com
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/instrument.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/executor/instrument.c b/src/backend/executor/instrument.c index ef2a24b7cfb..c383f34c066 100644 --- a/src/backend/executor/instrument.c +++ b/src/backend/executor/instrument.c @@ -237,6 +237,8 @@ BufferUsageAdd(BufferUsage *dst, const BufferUsage *add) dst->temp_blks_written += add->temp_blks_written; INSTR_TIME_ADD(dst->shared_blk_read_time, add->shared_blk_read_time); INSTR_TIME_ADD(dst->shared_blk_write_time, add->shared_blk_write_time); + INSTR_TIME_ADD(dst->local_blk_read_time, add->local_blk_read_time); + INSTR_TIME_ADD(dst->local_blk_write_time, add->local_blk_write_time); INSTR_TIME_ADD(dst->temp_blk_read_time, add->temp_blk_read_time); INSTR_TIME_ADD(dst->temp_blk_write_time, add->temp_blk_write_time); } @@ -261,6 +263,10 @@ BufferUsageAccumDiff(BufferUsage *dst, add->shared_blk_read_time, sub->shared_blk_read_time); INSTR_TIME_ACCUM_DIFF(dst->shared_blk_write_time, add->shared_blk_write_time, sub->shared_blk_write_time); + INSTR_TIME_ACCUM_DIFF(dst->local_blk_read_time, + add->local_blk_read_time, sub->local_blk_read_time); + INSTR_TIME_ACCUM_DIFF(dst->local_blk_write_time, + add->local_blk_write_time, sub->local_blk_write_time); INSTR_TIME_ACCUM_DIFF(dst->temp_blk_read_time, add->temp_blk_read_time, sub->temp_blk_read_time); INSTR_TIME_ACCUM_DIFF(dst->temp_blk_write_time, |