Re: Eagerly scan all-visible pages to amortize aggressive vacuum

From: Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Eagerly scan all-visible pages to amortize aggressive vacuum
Date: 2025-07-31 11:04:49
Message-ID: a67861d4-fb7d-457d-8e72-82d0377c7566@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I have a question about the documentation.

From description of the vacuum_max_eager_freeze_failure_rate [1]

"Specifies the maximum number of pages (as a fraction of total pages in
the relation) that VACUUM may scan and fail to set all-frozen in the
visibility map before disabling eager scanning."

It seems that after reaching the vacuum_max_eager_freeze_failure_rate,
the eager scanning of this table will be stopped. But in the source code
[2]:

 * cap. The failure count is reset for each region of the table --
comprised
 * of EAGER_SCAN_REGION_SIZE blocks. In each region, we tolerate
 * vacuum_max_eager_freeze_failure_rate of EAGER_SCAN_REGION_SIZE failures
 * before suspending eager scanning until the end of the region.

From this description, vacuum_max_eager_freeze_failure_rate limit
applies to a region of EAGER_SCAN_REGION_SIZE pages, but not to the
whole table.

Which one is correct? May be I'm missing something?
Do we need any clarifications in the documentation?

1.
https://www.postgresql.org/docs/devel/runtime-config-vacuum.html#GUC-VACUUM-MAX-EAGER-FREEZE-FAILURE-RATE
2.
https://github.com/postgres/postgres/blob/3357471cf9f5e470dfed0c7919bcf31c7efaf2b9/src/backend/access/heap/vacuumlazy.c#L82-L85

--
Pavel Luzanov
Postgres Professional: https://postgrespro.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2025-07-31 12:00:16 RE: POC: enable logical decoding when wal_level = 'replica' without a server restart
Previous Message Ajin Cherian 2025-07-31 10:52:26 Re: 024_add_drop_pub.pl might fail due to deadlock