RE: Wrong statistics for size of XLOG_SWITCH during pg_waldump.
shinya11.kato@nttdata.com
From: <Shinya11.Kato@nttdata.com>
To: <movead.li@highgo.ca>
Cc: <pgsql-hackers@postgresql.org>, <andres@anarazel.de>,
<michael@paquier.xyz>, <ahsan.hadi@highgo.ca>,
<horikyota.ntt@gmail.com>
Date: 2020-12-04T04:20:47Z
Lists: pgsql-hackers
When I execute pg_waldump, I found that XLOG/SWITCH_JUNK appears twice. Is this problem solved by the way of correcting the previously discussed Transaction/COMMIT? $ ../bin/pg_waldump --stats=record ../data/pg_wal/000000010000000000000001 Type N (%) Record size (%) FPI size (%) Combined size (%) ---- - --- ----------- --- -------- --- ------------- --- XLOG/CHECKPOINT_SHUTDOWN 5 ( 0.01) 570 ( 0.01) 0 ( 0.00) 570 ( 0.01) XLOG/CHECKPOINT_ONLINE 6 ( 0.02) 684 ( 0.02) 0 ( 0.00) 684 ( 0.01) XLOG/NEXTOID 3 ( 0.01) 90 ( 0.00) 0 ( 0.00) 90 ( 0.00) XLOG/FPI 290 ( 0.80) 14210 ( 0.34) 638216 ( 40.72) 652426 ( 11.30) Transaction/COMMIT 12 ( 0.03) 408 ( 0.01) 0 ( 0.00) 408 ( 0.01) Transaction/COMMIT 496 ( 1.36) 134497 ( 3.20) 0 ( 0.00) 134497 ( 2.33) Storage/CREATE 13 ( 0.04) 546 ( 0.01) 0 ( 0.00) 546 ( 0.01) CLOG/ZEROPAGE 1 ( 0.00) 30 ( 0.00) 0 ( 0.00) 30 ( 0.00) Database/CREATE 2 ( 0.01) 84 ( 0.00) 0 ( 0.00) 84 ( 0.00) Standby/LOCK 142 ( 0.39) 5964 ( 0.14) 0 ( 0.00) 5964 ( 0.10) Standby/RUNNING_XACTS 13 ( 0.04) 666 ( 0.02) 0 ( 0.00) 666 ( 0.01) Standby/INVALIDATIONS 136 ( 0.37) 12416 ( 0.30) 0 ( 0.00) 12416 ( 0.22) Heap2/CLEAN 132 ( 0.36) 8994 ( 0.21) 0 ( 0.00) 8994 ( 0.16) Heap2/FREEZE_PAGE 245 ( 0.67) 168704 ( 4.01) 0 ( 0.00) 168704 ( 2.92) Heap2/CLEANUP_INFO 2 ( 0.01) 84 ( 0.00) 0 ( 0.00) 84 ( 0.00) Heap2/VISIBLE 424 ( 1.16) 25231 ( 0.60) 352256 ( 22.48) 377487 ( 6.54) XLOG/SWITCH_JUNK 0 ( 0.00) 0 ( 0.00) 0 ( 0.00) 0 ( 0.00) Heap2/MULTI_INSERT 1511 ( 4.15) 287727 ( 6.84) 12872 ( 0.82) 300599 ( 5.21) Heap2/MULTI_INSERT+INIT 46 ( 0.13) 71910 ( 1.71) 0 ( 0.00) 71910 ( 1.25) Heap/INSERT 8849 ( 24.31) 1288414 ( 30.62) 25648 ( 1.64) 1314062 ( 22.76) Heap/DELETE 25 ( 0.07) 1350 ( 0.03) 0 ( 0.00) 1350 ( 0.02) Heap/UPDATE 173 ( 0.48) 55238 ( 1.31) 5964 ( 0.38) 61202 ( 1.06) Heap/HOT_UPDATE 257 ( 0.71) 27585 ( 0.66) 1300 ( 0.08) 28885 ( 0.50) XLOG/SWITCH_JUNK 0 ( 0.00) 0 ( 0.00) 0 ( 0.00) 0 ( 0.00) Heap/LOCK 180 ( 0.49) 9800 ( 0.23) 129812 ( 8.28) 139612 ( 2.42) Heap/INPLACE 214 ( 0.59) 44520 ( 1.06) 40792 ( 2.60) 85312 ( 1.48) Heap/INSERT+INIT 171 ( 0.47) 171318 ( 4.07) 0 ( 0.00) 171318 ( 2.97) Regards, Shinya Kato
Commits
-
pg_waldump: Fix bug in per-record statistics.
- e73068b0710b 9.6.22 landed
- 5386a8506d7d 10.17 landed
- 4a2627c41cfe 11.12 landed
- 4220e06f4c0c 12.7 landed
- 34279fd4fabd 13.3 landed
- 51893c846350 14.0 landed