postgresql/src/include
Andres Freund 28e626bde0 pgstat: Infrastructure for more detailed IO statistics
This commit adds the infrastructure for more detailed IO statistics. The calls
to actually count IOs, a system view to access the new statistics,
documentation and tests will be added in subsequent commits, to make review
easier.

While we already had some IO statistics, e.g. in pg_stat_bgwriter and
pg_stat_database, they did not provide sufficient detail to understand what
the main sources of IO are, or whether configuration changes could avoid
IO. E.g., pg_stat_bgwriter.buffers_backend does contain the number of buffers
written out by a backend, but as that includes extending relations (always
done by backends) and writes triggered by the use of buffer access strategies,
it cannot easily be used to tune background writer or checkpointer. Similarly,
pg_stat_database.blks_read cannot easily be used to tune shared_buffers /
compute a cache hit ratio, as the use of buffer access strategies will often
prevent a large fraction of the read blocks to end up in shared_buffers.

The new IO statistics count IO operations (evict, extend, fsync, read, reuse,
and write), and are aggregated for each combination of backend type (backend,
autovacuum worker, bgwriter, etc), target object of the IO (relations, temp
relations) and context of the IO (normal, vacuum, bulkread, bulkwrite).

What is tracked in this series of patches, is sufficient to perform the
aforementioned analyses. Further details, e.g. tracking the number of buffer
hits, would make that even easier, but was left out for now, to keep the scope
of the already large patchset manageable.

Bumps PGSTAT_FILE_FORMAT_ID.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>
Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/20200124195226.lth52iydq2n2uilq@alap3.anarazel.de
2023-02-08 20:53:42 -08:00
..
access Remove stray duplicated comment in heapam.h 2023-02-08 16:03:26 +13:00
backup Update copyright for 2023 2023-01-02 15:00:37 -05:00
bootstrap Update copyright for 2023 2023-01-02 15:00:37 -05:00
catalog Make Vars be outer-join-aware. 2023-01-30 13:16:20 -05:00
commands Revert "Add eager and lazy freezing strategies to VACUUM." 2023-01-25 22:22:27 -08:00
common Revert refactoring of restore command code to shell_restore.c 2023-02-06 08:28:42 +09:00
datatype Code review for commit 05a7be935. 2023-01-26 12:51:00 -05:00
executor Make new GENERATED-expressions code more bulletproof. 2023-01-15 13:14:52 -05:00
fe_utils Update copyright for 2023 2023-01-02 15:00:37 -05:00
foreign Update copyright for 2023 2023-01-02 15:00:37 -05:00
jit Update copyright for 2023 2023-01-02 15:00:37 -05:00
lib Avoid type cheats for invalid dsa_handles and dshash_table_handles. 2023-01-25 11:48:38 -05:00
libpq Retire PG_SETMASK() macro. 2023-02-03 11:29:46 +13:00
mb Update copyright for 2023 2023-01-02 15:00:37 -05:00
nodes Include values of A_Const nodes in query jumbling 2023-02-07 09:03:54 +09:00
optimizer Invent "join domains" to replace the below_outer_join hack. 2023-01-30 13:50:25 -05:00
parser Make Vars be outer-join-aware. 2023-01-30 13:16:20 -05:00
partitioning Update copyright for 2023 2023-01-02 15:00:37 -05:00
pch Update copyright for 2023 2023-01-02 15:00:37 -05:00
port Update copyright for 2023 2023-01-02 15:00:37 -05:00
portability instr_time: Represent time as an int64 on all platforms 2023-01-20 21:16:47 -08:00
postmaster Disable STARTUP_PROGRESS_TIMEOUT in standby mode. 2023-02-06 10:51:08 -05:00
regex Update copyright for 2023 2023-01-02 15:00:37 -05:00
replication Fix the logical replication timeout during large DDLs. 2023-02-08 07:58:25 +05:30
rewrite Make Vars be outer-join-aware. 2023-01-30 13:16:20 -05:00
snowball Update copyright for 2023 2023-01-02 15:00:37 -05:00
statistics Update copyright for 2023 2023-01-02 15:00:37 -05:00
storage Avoid type cheats for invalid dsa_handles and dshash_table_handles. 2023-01-25 11:48:38 -05:00
tcop Update copyright for 2023 2023-01-02 15:00:37 -05:00
tsearch Fix ts_headline() to handle ORs and phrase queries more honestly. 2023-01-19 16:21:44 -05:00
utils pgstat: Infrastructure for more detailed IO statistics 2023-02-08 20:53:42 -08:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
fmgr.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
funcapi.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
getopt_long.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
Makefile Move gramparse.h to src/backend/parser 2022-09-14 10:57:13 +07:00
meson.build New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
miscadmin.h pgstat: Infrastructure for more detailed IO statistics 2023-02-08 20:53:42 -08:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_config.h.in Remove configure probe for sockaddr_in6 and require AF_INET6. 2022-08-26 10:18:30 +12:00
pg_getopt.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pg_trace.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgstat.h pgstat: Infrastructure for more detailed IO statistics 2023-02-08 20:53:42 -08:00
pgtar.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
pgtime.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
port.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2023 2023-01-02 15:00:37 -05:00
postgres.h New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
varatt.h New header varatt.h split off from postgres.h 2023-01-10 05:54:36 +01:00
windowapi.h Update copyright for 2023 2023-01-02 15:00:37 -05:00