Re: Table AM Interface Enhancements

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Table AM Interface Enhancements
Date: 2024-03-18 23:34:13
Message-ID: CAPpHfduey2T2jebBzUiVAVivyNjRQ22EH_K=F6VCozB=f13tzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Mar 3, 2024 at 1:50 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> On Mon, Nov 27, 2023 at 10:18 PM Mark Dilger
> <mark(dot)dilger(at)enterprisedb(dot)com> wrote:
> >
> > > On Nov 25, 2023, at 9:47 AM, Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> > >
> > >> Should the patch at least document which parts of the EState are expected to be in which states, and which parts should be viewed as undefined? If the implementors of table AMs rely on any/all aspects of EState, doesn't that prevent future changes to how that structure is used?
> > >
> > > New tuple tuple_insert_with_arbiter() table AM API method needs EState
> > > argument to call executor functions: ExecCheckIndexConstraints(),
> > > ExecUpdateLockMode(), and ExecInsertIndexTuples(). I think we
> > > probably need to invent some opaque way to call this executor function
> > > without revealing EState to table AM. Do you think this could work?
> >
> > We're clearly not accessing all of the EState, just some specific fields, such as es_per_tuple_exprcontext. I think you could at least refactor to pass the minimum amount of state information through the table AM API.
>
> Yes, the table AM doesn't need the full EState, just the ability to do
> specific manipulation with tuples. I'll refactor the patch to make a
> better isolation for this.

Please find the revised patchset attached. The changes are following:
1. Patchset is rebase. to the current master.
2. Patchset is reordered. I tried to put less debatable patches to the top.
3. tuple_is_current() method is moved from the Table AM API to the
slot as proposed by Matthias van de Meent.
4. Assert added to the table_free_rd_amcache() as proposed by Pavel Borisov.

------
Regards,
Alexander Korotkov

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-03-18 23:34:23 Re: documentation structure
Previous Message David Rowley 2024-03-18 23:30:50 Re: Popcount optimization using AVX512