Re: Eagerly scan all-visible pages to amortize aggressive vacuum
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Melanie Plageman <melanieplageman@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Robert Treat <rob@xzilla.net>, Marcos Pegoraro <marcos@f10.com.br>,
Alena Rybakina <a.rybakina@postgrespro.ru>, Nazir Bilal Yavuz <byavuz81@gmail.com>,
Pg Hackers <pgsql-hackers@postgresql.org>, Peter Geoghegan <pg@bowt.ie>
Date: 2025-02-11T01:06:12Z
Lists: pgsql-hackers
Hi, On 2025-02-04 12:44:22 -0500, Melanie Plageman wrote: > On Mon, Feb 3, 2025 at 9:09 PM Andres Freund <andres@anarazel.de> wrote: > > > + /* > > > + * Now calculate the eager scan start block. Start at a random spot > > > + * somewhere within the first eager scan region. This avoids eager > > > + * scanning and failing to freeze the exact same blocks each vacuum of the > > > + * relation. > > > + */ > > > > If I understand correctly, we're not really choosing a spot inside the first > > eager scan region, we determine the bounds of the first region? > > I'm not sure I understand how those are different, but I updated the > comment a bit. Maybe you can elaborate what you mean? Let's assume that we use regions of 512 pages. Without randomness we'd do: [0 .. 512) [512 .. 1024) ... IMO, if we were to choose a spot inside the first region, we'd do: [random(0, 512) .. 512) [512 .. 1024) If we choose the bounds of the first region we'd do: [0, random(0, 512)) [$prior bound .. $prior_bound + 512) or something like that. Greetings, Andres Freund PS: planning to respond to cleanup lock stuff downthread, after a bit of exercise or tomorrow morning
Commits
-
pg_stat_statements: Add counters for generic and custom plans
- 3357471cf9f5 19 (unreleased) cited
-
Remove leftover mentions of XLOG_HEAP2_FREEZE_PAGE records
- b7493e1ab353 18.0 landed
-
Rename LVRelState->frozen_pages
- f020baa0662c 18.0 landed