Doc fix of aggressive vacuum threshold for multixact members storage
Alex Friedman <alexf01@gmail.com>
From: Alex Friedman <alexf01@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-02-02T15:10:54Z
Lists: pgsql-hackers
Attachments
- v1-0001-Doc-fix-of-aggressive-vacuum-threshold-for-multix.patch (application/octet-stream) patch v1-0001
Hi, This patch suggests a correction to the doc page dealing with multixact vacuuming, which, starting with PG 14, says that the multixact members storage threshold for aggressive vacuum is 2 GB. However, I believe the threshold is actually about 10 GB. MultiXactMemberFreezeThreshold() defines the threshold as 2^32 (0xFFFFFFFF) / 2 or 2^31 multixact members. However, as discussed in multixact.c, multixact members are stored in groups of 4, each group taking up 20 bytes, meaning 5 bytes per member. (This is not quite exact as 12 bytes per 8 KB page are wasted, but I believe it is close enough for the docs.) This makes the threshold in bytes be 2^31 multixact members * 5 bytes per member = 10 GiB. It was also confirmed by observing a live system (with an admittedly unfortunate workload pattern). Also, the maximum storage size for multixact members is 20 GiB (2^32 * 5), and it should be useful to call this out in the doc as well. For reference, the original commit which introduced the current wording is c552e17, and the discussion was here: https://www.postgresql.org/message-id/flat/162395467510.686.11947486273299446208%40wrigleys.postgresql.org The attached patch is against master, but it should probably be backpatched all the way through 14. Best regards, Alex Friedman
Commits
-
Doc: correct aggressive vacuum threshold for multixact members storage
- be342766fb02 14.18 landed
- bc6a81ac3a83 15.13 landed
- 98aa99b6d682 16.9 landed
- 5c8dcf948334 17.5 landed
- fcabc3adf889 18.0 landed
-
docs: clarify new aggressive vacuum mode for multi-xacts
- c552e171d16e 15.0 cited
-
Increase threshold for multixact member emergency autovac to 50%.
- b4d4ce1d50bb 9.5.0 cited