Re: Introduce new multi insert Table AM and improve performance of various SQL commands with it for Heap AM
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, PostgreSQL-development
<pgsql-hackers@postgresql.org>, Andres Freund <andres@anarazel.de>, Dilip
Kumar <dilipbalaut@gmail.com>, Luc Vlaming <luc@swarm64.com>, Justin Pryzby
<pryzby@telsasoft.com>, Michael Paquier <michael@paquier.xyz>, Matthias van
de Meent <boekewurm+postgres@gmail.com>, Alexander Korotkov
<aekorotkov@gmail.com>
Date: 2024-04-25T16:41:08Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
libpq: Fix some issues in TAP tests for service files
- 2c7bd2ba507e 18.0 cited
-
Multiple revisions to the GROUP BY reordering tests
- 874d817baa16 17.0 cited
-
Explore alternative orderings of group-by pathkeys during optimization.
- 0452b461bc40 17.0 cited
On Wed, 2024-04-24 at 18:19 +0530, Bharath Rupireddy wrote: > I added a flush callback named TableModifyBufferFlushCallback; when > provided by callers invoked after tuples are flushed to disk from the > buffers but before the AM frees them up. Index insertions and AFTER > ROW INSERT triggers can be executed in this callback. See the v19- > 0001 patch for how AM invokes the flush callback, and see either v19- > 0003 or v19-0004 or v19-0005 for how a caller can supply the callback > and required context to execute index insertions and AR triggers. The flush callback takes a pointer to an array of slot pointers, and I don't think that's the right API. I think the callback should be called on each slot individually. We shouldn't assume that a table AM stores buffered inserts as an array of slot pointers. A TupleTableSlot has a fair amount of memory overhead (64 bytes), so most AMs wouldn't want to pay that overhead for every tuple. COPY does, but that's because the number of buffered tuples is fairly small. > > > > 11. Deprecate the multi_insert API. > > I did remove both table_multi_insert and table_finish_bulk_insert in > v19-0006. That's OK with me. Let's leave those functions out for now. > > If the design, code and benefits that these new Table AMs bring to > the table look good, I hope to see it for PG 18. Sounds good. Regards, Jeff Davis