Re: Pluggable Storage - Andres's take
Andres Freund <andres@anarazel.de>
Attachments
- v21-0001-tableam-Add-tuple_-insert-delete-update-lock-and.patch.gz (application/x-patch-gzip) patch v21-0001
- v21-0002-tableam-Add-fetch_row_version.patch.gz (application/x-patch-gzip) patch v21-0002
- v21-0003-tableam-Add-use-tableam_fetch_follow_check.patch.gz (application/x-patch-gzip) patch v21-0003
- v21-0004-tableam-Add-table_get_latest_tid.patch.gz (application/x-patch-gzip) patch v21-0004
- v21-0005-tableam-multi_insert-and-slotify-COPY.patch.gz (application/x-patch-gzip) patch v21-0005
- v21-0006-tableam-finish_bulk_insert.patch.gz (application/x-patch-gzip) patch v21-0006
- v21-0007-tableam-slotify-CREATE-TABLE-AS-and-CREATE-MATER.patch.gz (application/x-patch-gzip) patch v21-0007
- v21-0008-tableam-index-builds.patch.gz (application/x-patch-gzip) patch v21-0008
- v21-0009-tableam-relation-creation-VACUUM-FULL-CLUSTER-SE.patch.gz (application/x-patch-gzip) patch v21-0009
- v21-0010-tableam-VACUUM-and-ANALYZE.patch.gz (application/x-patch-gzip) patch v21-0010
- v21-0011-tableam-planner-size-estimation.patch.gz (application/x-patch-gzip) patch v21-0011
- v21-0012-tableam-Sample-Scan-Support.patch.gz (application/x-patch-gzip) patch v21-0012
- v21-0013-tableam-bitmap-heap-scan.patch.gz (application/x-patch-gzip) patch v21-0013
- v21-0014-tableam-Only-allow-heap-in-a-number-of-contrib-m.patch.gz (application/x-patch-gzip) patch v21-0014
- v21-0015-WIP-Move-xid-horizon-computation-for-page-level-.patch.gz (application/x-patch-gzip) patch v21-0015
- v21-0016-tableam-Add-function-to-determine-newest-xid-amo.patch.gz (application/x-patch-gzip) patch v21-0016
- v21-0017-tableam-Fetch-tuples-for-triggers-EPQ-using-a-pr.patch.gz (application/x-patch-gzip) patch v21-0017
Hi,
(sorry, I somehow miskeyed, and sent a partial version of this email
before it was ready)
On 2019-03-21 11:15:57 -0700, Andres Freund wrote:
> Pending work:
> - Wondering if table_insert/delete/update should rather be
> table_tuple_insert etc. Would be a bit more consistent with the
> callback names, but a bigger departure from existing code.
I've left this as is.
> - I'm not yet happy with TableTupleDeleted computation in heapam.c, I
> want to revise that further
I changed that. Found a bunch of untested paths, I've pushed tests for
those already.
> - formatting
Done that.
> - commit message
Done that.
> - a few comments need a bit of polishing (ExecCheckTIDVisible, heapam_tuple_lock)
Done that.
> - Rename TableTupleMayBeModified to TableTupleOk, but also probably a s/TableTuple/TableMod/
It's now TM_*.
/*
* Result codes for table_{update,delete,lock}_tuple, and for visibility
* routines inside table AMs.
*/
typedef enum TM_Result
{
/*
* Signals that the action succeeded (i.e. update/delete performed, lock
* was acquired)
*/
TM_Ok,
/* The affected tuple wasn't visible to the relevant snapshot */
TM_Invisible,
/* The affected tuple was already modified by the calling backend */
TM_SelfModified,
/*
* The affected tuple was updated by another transaction. This includes
* the case where tuple was moved to another partition.
*/
TM_Updated,
/* The affected tuple was deleted by another transaction */
TM_Deleted,
/*
* The affected tuple is currently being modified by another session. This
* will only be returned if (update/delete/lock)_tuple are instructed not
* to wait.
*/
TM_BeingModified,
/* lock couldn't be acquired, action skipped. Only used by lock_tuple */
TM_WouldBlock
} TM_Result;
> - I'll probably move TUPLE_LOCK_FLAG_LOCK_* into tableam.h
Done.
> - two more passes through the patch
One of them completed. Which is good, because there was a subtle bug in
heapam_tuple_lock (*tid was adjusted to be the followup tuple after the
heap_fetch(), before going to heap_lock_tuple - but that's wrong, it
should only be adjusted when heap_fetch() ing the next version.).
I'm pretty happy with that last version (of the first patch). I'm
planning to do one more pass, and then push.
There are no meaningful changes to later patches in the series besides
followup changes required from changes in the first patch.
Greetings,
Andres Freund
Commits
-
Add default_table_access_method to postgresql.conf.sample.
- 3a5c08aa0267 12.0 landed
- f7db0ac7d5b6 13.0 landed
-
tableam: Avoid relying on relation size to determine validity of tids.
- 147e3722f7e5 12.0 landed
-
tableam: Don't assume that every AM uses md.c style storage.
- 7f44ede59414 12.0 landed
-
Allow pg_class xid & multixid horizons to not be set.
- fdc7efcc30b1 12.0 landed
-
Fix slot type issue for fuzzy distance index scan over out-of-core table AM.
- b8b94ea129ff 12.0 cited
-
tableam: comment and formatting fixes.
- 6421011ea24d 12.0 landed
-
table: docs: fix typos and grammar.
- 86cc06d1cf9c 12.0 landed
-
tableam: basic documentation.
- b73c3a11963c 12.0 landed
-
Only allow heap in a number of contrib modules.
- 4b82664156c2 12.0 landed
-
tableam: Add table_finish_bulk_insert().
- d45e40158623 12.0 landed
-
tableam: sample scan.
- 73c954d24896 12.0 landed
-
tableam: bitmap table scan.
- bfbcad478f05 12.0 landed
-
tableam: Move heap specific logic from estimate_rel_size below tableam.
- 696d78469f37 12.0 landed
-
tableam: VACUUM and ANALYZE support.
- 737a292b5de2 12.0 landed
-
tableam: relation creation, VACUUM FULL/CLUSTER, SET TABLESPACE.
- d25f519107bf 12.0 landed
-
tableam: Support for an index build's initial table scan(s).
- 2a96909a4a8c 12.0 landed
-
tableam: Add table_get_latest_tid, to wrap heap_get_latest_tid.
- 2e3da03e9ee4 12.0 landed
-
tableam: Add helper for indexes to check if a corresponding table tuples exist.
- 71bdc99d0d7c 12.0 landed
-
tableam: Add and use table_fetch_row_version().
- 9a8ee1dc650b 12.0 landed
-
tableam: Use in CREATE TABLE AS and CREATE MATERIALIZED VIEW.
- 919e48b94301 12.0 landed
-
Ensure sufficient alignment for ParallelTableScanDescData in BTShared.
- 8cacea7a7251 12.0 landed
-
Don't reuse slots between root and partition in ON CONFLICT ... UPDATE.
- 277cb789836b 12.0 landed
-
Use a virtual rather than a heap slot in two places where that suffices.
- 70b9bda65f81 12.0 landed
-
Store tuples for EvalPlanQual in slots, rather than as HeapTuples.
- ad0bda5d24ea 12.0 landed
-
Use slots in trigger infrastructure, except for the actual invocation.
- ff11e7f4b9ae 12.0 landed
-
Store table oid and tuple's tid in tuple slots directly.
- b8d71745eac0 12.0 landed
-
Allow to use HeapTupleData embedded in [Buffer]HeapTupleTableSlot.
- 5408e233f066 12.0 landed
-
Add ExecStorePinnedBufferHeapTuple.
- 8aa02b52db11 12.0 landed
-
Add ArchiveOpts to pass options to ArchiveEntry
- f831d4accda0 12.0 cited
-
Rename RelationData.rd_amroutine to rd_indam.
- 346ed70b0ad7 12.0 landed
-
Rephrase references to "time qualification".
- ebcc7bf949ba 12.0 landed
-
Move remaining code from tqual.[ch] to heapam.h / heapam_visibility.c.
- c91560defc57 12.0 landed
-
Move generic snapshot related code from tqual.h to snapmgr.h.
- b7eda3e0e334 12.0 landed
-
Remove superfluous tqual.h includes.
- e7cc78ad43eb 12.0 landed
-
Don't duplicate parallel seqscan shmem sizing logic in nbtree.
- 90525d7b4e0f 12.0 landed
-
Move vacuumlazy.c into access/heap.
- 285d8e12055f 12.0 landed
-
Support parallel bitmap heap scans.
- f35742ccb7aa 10.0 cited