Table AM Interface Enhancements

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Table AM Interface Enhancements
Date: 2023-11-23 12:42:49
Message-ID: CAPpHfdurb9ycV8udYqM=o0sPS66PJ4RCBM1g-bBpvzUfogY0EA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello PostgreSQL Hackers,

I am pleased to submit a series of patches related to the Table Access
Method (AM) interface, which I initially announced during my talk at
PGCon 2023 [1]. These patches are primarily designed to support the
OrioleDB engine, but I believe they could be beneficial for other
table AM implementations as well.

The focus of these patches is to introduce more flexibility and
capabilities into the Table AM interface. This is particularly
relevant for advanced use cases like index-organized tables,
alternative MVCC implementations, etc.

Here's a brief overview of the patches included in this set:

0001-Allow-locking-updated-tuples-in-tuple_update-and--v1.patch

Optimizes the process of locking concurrently updated tuples during
update and delete operations. Helpful for table AMs where refinding
existing tuples is expensive.

0002-Add-EvalPlanQual-delete-returning-isolation-test-v1.patch

The new isolation test is related to the previous patch. These two
patches were previously discussed in [2].

0003-Allow-table-AM-to-store-complex-data-structures-i-v1.patch

Allows table AM to store complex data structure in rd_amcache rather
than a single chunk of memory.

0004-Add-table-AM-tuple_is_current-method-v1.patch

This allows us to abstract how/whether table AM uses transaction identifiers.

0005-Generalize-relation-analyze-in-table-AM-interface-v1.patch

Provides a more flexible API for sampling tuples, beneficial for
non-standard table types like index-organized tables.

0006-Generalize-table-AM-API-for-INSERT-.-ON-CONFLICT-v1.patch

Provides a new table AM API method to encapsulate the whole INSERT ...
ON CONFLICT ... algorithm rather than just implementation of
speculative tokens.

0007-Allow-table-AM-tuple_insert-method-to-return-the--v1.patch

This allows table AM to return a native tuple slot, which is aware of
table AM-specific system attributes.

0008-Let-table-AM-insertion-methods-control-index-inse-v1.patch

Allows table AM to skip index insertions in the executor and handle
those insertions itself.

0009-Custom-reloptions-for-table-AM-v1.patch

Enables table AMs to define and override reloptions for tables and indexes.

0010-Notify-table-AM-about-index-creation-v1.patch

Allows table AMs to prepare or update specific meta-information during
index creation.

011-Introduce-RowRefType-which-describes-the-table-ro-v1.patch

Separates the row identifier type from the lock mode in RowMarkType,
providing clearer semantics and more flexibility.

0012-Introduce-RowID-bytea-tuple-identifier-v1.patch

`This patch introduces 'RowID', a new bytea tuple identifier, to
overcome the limitations of the current 32-bit block number and 16-bit
offset-based tuple identifier. This is particularly useful for
index-organized tables and other advanced use cases.

Each commit message contains a detailed explanation of the changes and
their rationale. I believe these enhancements will significantly
improve the flexibility and capabilities of the PostgreSQL Table AM
interface.

I am looking forward to your feedback and suggestions on these patches.

Links

1. https://www.pgcon.org/events/pgcon_2023/schedule/session/470-future-of-table-access-methods/
2. https://www.postgresql.org/message-id/CAPpHfdua-YFw3XTprfutzGp28xXLigFtzNbuFY8yPhqeq6X5kg%40mail.gmail.com

------
Regards,
Alexander Korotkov

Attachment Content-Type Size
0002-Add-EvalPlanQual-delete-returning-isolation-test-v1.patch application/octet-stream 3.0 KB
0001-Allow-locking-updated-tuples-in-tuple_update-and--v1.patch application/octet-stream 61.0 KB
0003-Allow-table-AM-to-store-complex-data-structures-i-v1.patch application/octet-stream 5.4 KB
0004-Add-table-AM-tuple_is_current-method-v1.patch application/octet-stream 4.2 KB
0005-Generalize-relation-analyze-in-table-AM-interface-v1.patch application/octet-stream 29.2 KB
0006-Generalize-table-AM-API-for-INSERT-.-ON-CONFLICT-v1.patch application/octet-stream 27.5 KB
0007-Allow-table-AM-tuple_insert-method-to-return-the--v1.patch application/octet-stream 3.9 KB
0009-Custom-reloptions-for-table-AM-v1.patch application/octet-stream 15.1 KB
0010-Notify-table-AM-about-index-creation-v1.patch application/octet-stream 6.6 KB
0008-Let-table-AM-insertion-methods-control-index-inse-v1.patch application/octet-stream 13.5 KB
0012-Introduce-RowID-bytea-tuple-identifier-v1.patch application/octet-stream 61.6 KB
0011-Introduce-RowRefType-which-describes-the-table-ro-v1.patch application/octet-stream 15.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2023-11-23 13:13:30 Re: Catalog domain not-null constraints
Previous Message Matthias van de Meent 2023-11-23 12:33:44 Re: Parallel CREATE INDEX for BRIN indexes