mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Rename I/O timing statistics columns to shared_blk_{read|write}_time
These two counters, defined in BufferUsage to track respectively the
time spent while reading and writing blocks have historically only
tracked data related to shared buffers, when track_io_timing is enabled.
An upcoming patch to add specific counters for local buffers will take
advantage of this rename as it has come up that no data is currently
tracked for local buffers, and tracking local and shared buffers using
the same fields would be inconsistent with the treatment done for temp
buffers. Renaming the existing fields clarifies what the block type of
each stats field is.
pg_stat_statement is updated to reflect the rename. No extension
version bump is required as 5a3423ad8e
has done one, affecting v17~.
Author: Nazir Bilal Yavuz
Reviewed-by: Robert Haas, Melanie Plageman
Discussion: https://postgr.es/m/CAN55FZ19Ss279mZuqGbuUNxka0iPbLgYuOQXqAKewrjNrp27VA@mail.gmail.com
This commit is contained in:
@ -284,8 +284,8 @@ AlTER EXTENSION pg_stat_statements UPDATE TO '1.11';
|
||||
local_blks_written | bigint | | |
|
||||
temp_blks_read | bigint | | |
|
||||
temp_blks_written | bigint | | |
|
||||
blk_read_time | double precision | | |
|
||||
blk_write_time | double precision | | |
|
||||
shared_blk_read_time | double precision | | |
|
||||
shared_blk_write_time | double precision | | |
|
||||
temp_blk_read_time | double precision | | |
|
||||
temp_blk_write_time | double precision | | |
|
||||
wal_records | bigint | | |
|
||||
|
@ -41,8 +41,8 @@ CREATE FUNCTION pg_stat_statements(IN showtext boolean,
|
||||
OUT local_blks_written int8,
|
||||
OUT temp_blks_read int8,
|
||||
OUT temp_blks_written int8,
|
||||
OUT blk_read_time float8,
|
||||
OUT blk_write_time float8,
|
||||
OUT shared_blk_read_time float8,
|
||||
OUT shared_blk_write_time float8,
|
||||
OUT temp_blk_read_time float8,
|
||||
OUT temp_blk_write_time float8,
|
||||
OUT wal_records int8,
|
||||
|
@ -180,8 +180,10 @@ typedef struct Counters
|
||||
int64 local_blks_written; /* # of local disk blocks written */
|
||||
int64 temp_blks_read; /* # of temp blocks read */
|
||||
int64 temp_blks_written; /* # of temp blocks written */
|
||||
double blk_read_time; /* time spent reading blocks, in msec */
|
||||
double blk_write_time; /* time spent writing blocks, in msec */
|
||||
double shared_blk_read_time; /* time spent reading shared blocks,
|
||||
* in msec */
|
||||
double shared_blk_write_time; /* time spent writing shared blocks,
|
||||
* in msec */
|
||||
double temp_blk_read_time; /* time spent reading temp blocks, in msec */
|
||||
double temp_blk_write_time; /* time spent writing temp blocks, in
|
||||
* msec */
|
||||
@ -1391,8 +1393,8 @@ pgss_store(const char *query, uint64 queryId,
|
||||
e->counters.local_blks_written += bufusage->local_blks_written;
|
||||
e->counters.temp_blks_read += bufusage->temp_blks_read;
|
||||
e->counters.temp_blks_written += bufusage->temp_blks_written;
|
||||
e->counters.blk_read_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_read_time);
|
||||
e->counters.blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->blk_write_time);
|
||||
e->counters.shared_blk_read_time += INSTR_TIME_GET_MILLISEC(bufusage->shared_blk_read_time);
|
||||
e->counters.shared_blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->shared_blk_write_time);
|
||||
e->counters.temp_blk_read_time += INSTR_TIME_GET_MILLISEC(bufusage->temp_blk_read_time);
|
||||
e->counters.temp_blk_write_time += INSTR_TIME_GET_MILLISEC(bufusage->temp_blk_write_time);
|
||||
e->counters.usage += USAGE_EXEC(total_time);
|
||||
@ -1823,8 +1825,8 @@ pg_stat_statements_internal(FunctionCallInfo fcinfo,
|
||||
values[i++] = Int64GetDatumFast(tmp.temp_blks_written);
|
||||
if (api_version >= PGSS_V1_1)
|
||||
{
|
||||
values[i++] = Float8GetDatumFast(tmp.blk_read_time);
|
||||
values[i++] = Float8GetDatumFast(tmp.blk_write_time);
|
||||
values[i++] = Float8GetDatumFast(tmp.shared_blk_read_time);
|
||||
values[i++] = Float8GetDatumFast(tmp.shared_blk_write_time);
|
||||
}
|
||||
if (api_version >= PGSS_V1_10)
|
||||
{
|
||||
|
Reference in New Issue
Block a user