Doc fix of aggressive vacuum threshold for multixact members storage

From: Alex Friedman <alexf01(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Doc fix of aggressive vacuum threshold for multixact members storage
Date: 2025-02-02 15:10:54
Message-ID: CACbFw60UOk6fCC02KsyT3OfU9Dnuq5roYxdw2aFisiN_p1L0bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v1-0001-Doc-fix-of-aggressive-vacuum-threshold-for-multix.patch application/octet-stream 1.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-02-02 16:47:13 Re: Cross-type index comparison support in contrib/btree_gin
Previous Message Álvaro Herrera 2025-02-02 13:45:35 Re: pgbench with partitioned tables