Add TIDStore, to store sets of TIDs (ItemPointerData) efficiently.
authorMasahiko Sawada <msawada@postgresql.org>
Thu, 21 Mar 2024 01:08:42 +0000 (10:08 +0900)
committerMasahiko Sawada <msawada@postgresql.org>
Thu, 21 Mar 2024 01:08:42 +0000 (10:08 +0900)
commit30e144287a72529c9cd9fd6b07fe96eb8a1e270e
tree2ced2409e5f62c9f198486b6be3cd74cec18682e
parent995e0fbc1c57c9b705c57de456d25c6e448bc5dd
Add TIDStore, to store sets of TIDs (ItemPointerData) efficiently.

TIDStore is a data structure designed to efficiently store large sets
of TIDs. For TID storage, it employs a radix tree, where the key is
a block number, and the value is a bitmap representing offset
numbers. The TIDStore can be created on a DSA area and used by
multiple backend processes simultaneously.

There are potential future users such as tidbitmap.c, though it's very
likely the interface will need to evolve as we come to understand the
needs of different kinds of users. For example, we can support
updating the offset bitmap of existing values.

Currently, the TIDStore is not used for anything yet, aside from the
test code. But an upcoming patch will use it.

This includes a unit test module, in src/test/modules/test_tidstore.

Co-authored-by: John Naylor
Discussion: https://postgr.es/m/CAD21AoAfOZvmfR0j8VmZorZjL7RhTiQdVttNuC4W-Shdc2a-AA%40mail.gmail.com
15 files changed:
src/backend/access/common/Makefile
src/backend/access/common/meson.build
src/backend/access/common/tidstore.c [new file with mode: 0644]
src/include/access/tidstore.h [new file with mode: 0644]
src/test/modules/Makefile
src/test/modules/meson.build
src/test/modules/test_tidstore/.gitignore [new file with mode: 0644]
src/test/modules/test_tidstore/Makefile [new file with mode: 0644]
src/test/modules/test_tidstore/expected/test_tidstore.out [new file with mode: 0644]
src/test/modules/test_tidstore/meson.build [new file with mode: 0644]
src/test/modules/test_tidstore/sql/test_tidstore.sql [new file with mode: 0644]
src/test/modules/test_tidstore/test_tidstore--1.0.sql [new file with mode: 0644]
src/test/modules/test_tidstore/test_tidstore.c [new file with mode: 0644]
src/test/modules/test_tidstore/test_tidstore.control [new file with mode: 0644]
src/tools/pgindent/typedefs.list