Count updates that move row to a new page.
Peter Geoghegan <pg@bowt.ie>
Count updates that move row to a new page. Add pgstat counter to track row updates that result in the successor version going to a new heap page, leaving behind an original version whose t_ctid points to the new version. The current count is shown by the n_tup_newpage_upd column of each of the pg_stat_*_tables views. The new n_tup_newpage_upd column complements the existing n_tup_hot_upd and n_tup_upd columns. Tables that have high n_tup_newpage_upd values (relative to n_tup_upd) are good candidates for tuning heap fillfactor. Corey Huinker, with small tweaks by me. Author: Corey Huinker <corey.huinker@gmail.com> Reviewed-By: Peter Geoghegan <pg@bowt.ie> Reviewed-By: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CADkLM=ded21M9iZ36hHm-vj2rE2d=zcKpUQMds__Xm2pxLfHKA@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/monitoring.sgml | modified | +23 −5 |
| src/backend/access/heap/heapam.c | modified | +1 −1 |
| src/backend/catalog/system_views.sql | modified | +3 −1 |
| src/backend/utils/activity/pgstat_relation.c | modified | +10 −2 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +18 −0 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +10 −0 |
| src/include/pgstat.h | modified | +5 −3 |
| src/test/regress/expected/rules.out | modified | +9 −3 |
Documentation touched
Discussion
- Add n_tup_newpage_upd to pg_stat table views 12 messages · 2023-01-27 → 2023-03-23