Constant Splitting/Refactoring

From: David Christensen <david(dot)christensen(at)crunchydata(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, peter(at)eisentraut(dot)org
Subject: Constant Splitting/Refactoring
Date: 2024-02-07 16:57:48
Message-ID: CAOxo6XJUTj4QT87MJeqPj79+YLiLKeuVoysXe6SLWNU=2zrbrQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

As part of the reserved page space/page features[1] work, there is a need
to convert some of the existing constants into variables, since the size of
those will no longer be fixed at compile time. At FOSDEM, there was some
interest expressed about seeing what a cleanup patch like that would look
like.

Enclosed is a series of cleanup patches for HEAD. This splits each of the
4 constants that care about page size into Cluster-specific and -Limit
variants, the first intended to become a variable in time, and the second
being the maximum value such a variable may take (largely used for static
allocations).

Since these patches define these symbols to have the same values
they previously had, there are no changes in functionality. These were
largely mechanical changes, and as such we should perhaps consider making
the same changes to back-branches to make it so context lines and the like
would be the same, simplifying maintainer's efforts when applying code in
back branches that touch similar areas.

The script I have to make these changes is simple, and could be run against
the back branches with only the comments surrounding Calc() pieces needing
to be adjusted once.

These were based on HEAD as a few minutes ago, 902900b308f, and pass all
tests.
Thanks,

David

[1] https://commitfest.postgresql.org/47/3986/

Attachment Content-Type Size
v1-0002-Split-MaxHeapTupleSize-into-runtime-and-max-value.patch application/octet-stream 9.7 KB
v1-0001-Split-MaxHeapTuplesPerPage-into-runtime-and-max-v.patch application/octet-stream 24.5 KB
v1-0004-Split-MaxTIDsPerBTreePage-into-runtime-and-max-va.patch application/octet-stream 7.1 KB
v1-0003-Split-MaxIndexTuplesPerPage-into-runtime-and-max-.patch application/octet-stream 19.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-02-07 17:06:50 Re: common signal handler protection
Previous Message Greg Sabino Mullane 2024-02-07 16:51:37 Re: What about Perl autodie?