pgsql: Count updates that move row to a new page. - Mailing list pgsql-committers

From Peter Geoghegan
Subject pgsql: Count updates that move row to a new page.
Date
Msg-id E1pfPV5-0051VA-HP@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ae4fdde1352fa6b2c9123e91435efafc78c370a0

Modified Files
--------------
doc/src/sgml/monitoring.sgml                 | 28 +++++++++++++++++++++++-----
src/backend/access/heap/heapam.c             |  2 +-
src/backend/catalog/system_views.sql         |  4 +++-
src/backend/utils/activity/pgstat_relation.c | 12 ++++++++++--
src/backend/utils/adt/pgstatfuncs.c          | 18 ++++++++++++++++++
src/include/catalog/catversion.h             |  2 +-
src/include/catalog/pg_proc.dat              | 10 ++++++++++
src/include/pgstat.h                         |  8 +++++---
src/test/regress/expected/rules.out          | 12 +++++++++---
9 files changed, 80 insertions(+), 16 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Handle the "und" locale in ICU versions 54 and older.
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: doc: fix another case of missing productname markup