Re: New WAL record to detect the checkpoint redo location - Mailing list pgsql-hackers

From Robert Haas
Subject Re: New WAL record to detect the checkpoint redo location
Date
Msg-id CA+TgmoZY826g-+KtUxhxOMsGL+3K2MOzPeeZg2hfOb3nuNbfqw@mail.gmail.com
Whole thread Raw
In response to Re: New WAL record to detect the checkpoint redo location  (Andres Freund <andres@anarazel.de>)
Responses Re: New WAL record to detect the checkpoint redo location
Re: New WAL record to detect the checkpoint redo location
List pgsql-hackers
On Mon, Oct 9, 2023 at 4:47 PM Andres Freund <andres@anarazel.de> wrote:
> I think we might be able to speed some of this up by pre-compute values so we
> can implement things like bytesleft / UsableBytesInPage with shifts. IIRC we
> already insist on power-of-two segment sizes, so instead of needing to divide
> by a runtime value, we should be able to shift by a runtime value (and the
> modulo should be a mask).

Huh, is there a general technique for this when dividing by a
non-power-of-two? The segment size is a power of two, as is the page
size, but UsableBytesIn{Page,Segment} are some random value slightly
less than a power of two.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Remove distprep
Next
From: Michael Paquier
Date:
Subject: Re: Add a new BGWORKER_BYPASS_ROLELOGINCHECK flag