pgsql: Add TIDStore, to store sets of TIDs (ItemPointerData) efficientl

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add TIDStore, to store sets of TIDs (ItemPointerData) efficientl
Date: 2024-03-21 01:10:29
Message-ID: E1rn6wv-004rNm-9m@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/30e144287a72529c9cd9fd6b07fe96eb8a1e270e

Modified Files
--------------
src/backend/access/common/Makefile | 1 +
src/backend/access/common/meson.build | 1 +
src/backend/access/common/tidstore.c | 463 +++++++++++++++++++++
src/include/access/tidstore.h | 49 +++
src/test/modules/Makefile | 1 +
src/test/modules/meson.build | 1 +
src/test/modules/test_tidstore/.gitignore | 4 +
src/test/modules/test_tidstore/Makefile | 23 +
.../test_tidstore/expected/test_tidstore.out | 97 +++++
src/test/modules/test_tidstore/meson.build | 33 ++
.../modules/test_tidstore/sql/test_tidstore.sql | 65 +++
.../modules/test_tidstore/test_tidstore--1.0.sql | 27 ++
src/test/modules/test_tidstore/test_tidstore.c | 317 ++++++++++++++
.../modules/test_tidstore/test_tidstore.control | 4 +
src/tools/pgindent/typedefs.list | 5 +
15 files changed, 1091 insertions(+)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2024-03-21 05:31:55 pgsql: Allow dbname to be written as part of connstring via pg_baseback
Previous Message Tom Lane 2024-03-20 22:02:57 pgsql: Un-break genbki.pl's error reporting capabilities.