Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)
Melanie Plageman <melanieplageman@gmail.com>
Attachments
- v28-0003-Track-IO-operation-statistics-locally.patch (text/x-patch) patch v28-0003
- v28-0005-Add-system-view-tracking-IO-ops-per-backend-type.patch (text/x-patch) patch v28-0005
- v28-0002-Remove-unneeded-call-to-pgstat_report_wal.patch (text/x-patch) patch v28-0002
- v28-0001-Add-BackendType-for-standalone-backends.patch (text/x-patch) patch v28-0001
- v28-0004-Aggregate-IO-operation-stats-per-BackendType.patch (text/x-patch) patch v28-0004
v28 attached. I've added the new structs I added to typedefs.list. I've split the commit which adds all of the logic to track IO operation statistics into two commits -- one which includes all of the code to count IOOps for IOContexts locally in a backend and a second which includes all of the code to accumulate and manage these with the cumulative stats system. A few notes about the commit which adds local IO Operation stats: - There is a comment above pgstat_io_op_stats_collected() which mentions the cumulative stats system even though this commit doesn't engage the cumulative stats system. I wasn't sure if it was more or less confusing to have two different versions of this comment. - should pgstat_count_io_op() take BackendType as a parameter instead of using MyBackendType internally? - pgstat_count_io_op() Assert()s that the passed-in IOOp and IOContext are valid for this BackendType, but it doesn't check that all of the pending stats which should be zero are zero. I thought this was okay because if I did add that zero-check, it would be added to pgstat_count_ioop() as well, and we already Assert() there that we can count the op. Thus, it doesn't seem like checking that the stats are zero would add any additional regression protection. - I've kept pgstat_io_context_desc() and pgstat_io_op_desc() in the commit which adds those types (the local stats commit), however they are not used in that commit. I wasn't sure if I should keep them in that commit or move them to the first commit using them (the commit adding the new view). Notes on the commit which accumulates IO Operation stats in shared memory: - I've extended the usage of the Assert()s that IO Operation stats that should be zero are. Previously we only checked the stats validity when querying the view. Now we check it when flushing pending stats and when reading the stats file into shared memory. Note that the three locations with these validity checks (when flushing pending stats, when reading stats file into shared memory, and when querying the view) have similar looking code to loop through and validate the stats. However, the actual action they perform if the stats are valid is different for each site (adding counters together, doing a read, setting nulls in a tuple column to true). Also, some of these instances have other code interspersed in the loops which would require additional looping if separated from this logic. So it was difficult to see a way of combining these into a single helper function. - I've left pgstat_fetch_backend_io_context_ops() in the shared stats commit, however it is not used until the commit which adds the view in pg_stat_get_io(). I wasn't sure which way seemed better. - Melanie
Commits
-
Stabilize pg_stat_io writes test
- ef719e7b32fc 16.0 landed
-
Fix flakey pg_stat_io test
- 1be0fdb9de55 16.0 landed
-
Suppress more compiler warnings in new pgstats code.
- b1b86820d84e 16.0 landed
-
Suppress compiler warnings in new pgstats code.
- 728560db7d86 16.0 landed
-
Add tests for pg_stat_io
- 10a082bf7215 16.0 landed
-
Create regress_tblspc in test_setup
- 9c83bbcf7ef6 16.0 landed
-
Add pg_stat_io view, providing more detailed IO statistics
- a9c70b46dbe1 16.0 landed
-
pgstat: Track more detailed relation IO statistics
- f30d62c2fc60 16.0 landed
-
pgstat: Infrastructure for more detailed IO statistics
- 28e626bde00e 16.0 landed
-
doc: Fix some issues in logical replication section
- 4f74f5641d53 16.0 cited
-
Manual cleanup and pgindent of pgstat and bufmgr related code
- 250c8ee07ede 16.0 landed
-
Have the planner consider Incremental Sort for DISTINCT
- 3c6fc58209f2 16.0 cited
-
Use actual backend IDs in pg_stat_get_backend_idset() and friends.
- d7e39d72ca1c 16.0 cited
-
Remove redundant call to pgstat_report_wal()
- 1bdd54e662d5 16.0 landed
-
Add BackendType for standalone backends
- 0c679464a837 16.0 landed
-
Initialize backend status reporting during bootstrap.
- 3b34645678d1 15.0 landed