Table AM Interface Enhancements
Alexander Korotkov <aekorotkov@gmail.com>
Attachments
- 0002-Add-EvalPlanQual-delete-returning-isolation-test-v1.patch (application/octet-stream) patch v1-0002
- 0001-Allow-locking-updated-tuples-in-tuple_update-and--v1.patch (application/octet-stream) patch v1-0001
- 0003-Allow-table-AM-to-store-complex-data-structures-i-v1.patch (application/octet-stream) patch v1-0003
- 0004-Add-table-AM-tuple_is_current-method-v1.patch (application/octet-stream) patch v1-0004
- 0005-Generalize-relation-analyze-in-table-AM-interface-v1.patch (application/octet-stream) patch v1-0005
- 0006-Generalize-table-AM-API-for-INSERT-.-ON-CONFLICT-v1.patch (application/octet-stream) patch v1-0006
- 0007-Allow-table-AM-tuple_insert-method-to-return-the--v1.patch (application/octet-stream) patch v1-0007
- 0009-Custom-reloptions-for-table-AM-v1.patch (application/octet-stream) patch v1-0009
- 0010-Notify-table-AM-about-index-creation-v1.patch (application/octet-stream) patch v1-0010
- 0008-Let-table-AM-insertion-methods-control-index-inse-v1.patch (application/octet-stream) patch v1-0008
- 0012-Introduce-RowID-bytea-tuple-identifier-v1.patch (application/octet-stream) patch v1-0012
- 0011-Introduce-RowRefType-which-describes-the-table-ro-v1.patch (application/octet-stream) patch v1-0011
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
Commits
-
Remove extra comment at TableAmRoutine.scan_analyze_next_block
- 70a845c04a47 17.0 landed
-
revert: Generalize relation analyze in table AM interface
- 6377e12a5a52 17.0 landed
-
Revert: Allow table AM to store complex data structures in rd_amcache
- 922c4c461d21 17.0 landed
-
Revert: Allow table AM tuple_insert() method to return the different slot
- 8dd0bb84da7d 17.0 landed
-
Revert: Allow locking updated tuples in tuple_update() and tuple_delete()
- 193e6d18e553 17.0 landed
-
Revert: Let table AM insertion methods control index insertion
- da841aa4dc27 17.0 landed
-
Revert: Custom reloptions for table AM
- bc1e2092ebb8 17.0 landed
-
Provide a way block-level table AMs could re-use acquire_sample_rows()
- dd1f6b0c172a 17.0 landed
-
Custom reloptions for table AM
- 9bd99f4c26fe 17.0 landed
- c95c25f9af4b 17.0 landed
-
Use streaming I/O in ANALYZE.
- 041b96802efa 17.0 cited
-
Revert "Custom reloptions for table AM"
- 867cc7b6ddb9 17.0 landed
-
Let table AM insertion methods control index insertion
- b1484a3f1910 17.0 landed
-
Generalize relation analyze in table AM interface
- 27bc1772fc81 17.0 landed
-
Improve error message for tts_(virtual|minimal)_is_current_xact_tuple
- 41d3780d3d29 17.0 landed
-
Add comments on some MinimalTupleSlots methods usage
- 10baee0c95d1 17.0 landed
-
Add TupleTableSlotOps.is_current_xact_tuple() method
- 0997e0af273d 17.0 landed
-
Allow table AM tuple_insert() method to return the different slot
- c35a3fb5e067 17.0 landed
-
Allow table AM to store complex data structures in rd_amcache
- 02eb07ea89d2 17.0 landed