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