postgresql/src/backend/access/common
Masahiko Sawada 2d8f56dabb Rethink create and attach APIs of shared TidStore.
Previously, the behavior of TidStoreCreate() was inconsistent between
local and shared TidStore instances in terms of memory limitation. For
local TidStore, a memory context was created with initial and maximum
memory block sizes, as well as a minimum memory context size, based on
the specified max_bytes values. However, for shared TidStore, the
provided DSA area was used for TID storage. Although commit bb952c8c8b
allowed specifying the initial and maximum DSA segment sizes, callers
would have needed to clamp their own limits, which was not consistent
and user-friendly.

With this commit, when creating a shared TidStore, a dedicated DSA
area is created for TID storage instead of using a provided DSA
area. The initial and maximum DSA segment sizes are chosen based on
the specified max_bytes. Other processes can attach to the shared
TidStore using the handle of the created DSA returned by the new
TidStoreGetDSA() function and the DSA pointer returned by
TidStoreGetHandle(). The created DSA has the same lifetime as the
shared TidStore and is deleted when all processes detach from it.

To improve clarity, the TidStoreCreate() function has been divided
into two separate functions: TidStoreCreateLocal() and
TidStoreCreateShared().

Reviewed-by: John Naylor
Discussion: https://postgr.es/m/CAD21AoAyc1j%3DBCdUqZfk6qbdjZ68UgRx1Gkpk0oah4K7S0Ri9g%40mail.gmail.com
2024-03-28 10:03:28 +09:00
..
Makefile Add TIDStore, to store sets of TIDs (ItemPointerData) efficiently. 2024-03-21 10:08:42 +09:00
attmap.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
bufmask.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
detoast.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
heaptuple.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
indextuple.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
meson.build Add TIDStore, to store sets of TIDs (ItemPointerData) efficiently. 2024-03-21 10:08:42 +09:00
printsimple.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
printtup.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
relation.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
reloptions.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
scankey.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
session.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
syncscan.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
tidstore.c Rethink create and attach APIs of shared TidStore. 2024-03-28 10:03:28 +09:00
toast_compression.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
toast_internals.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tupconvert.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
tupdesc.c Separate equalRowTypes() from equalTupleDescs() 2024-03-17 05:58:04 +01:00