Re: New Table Access Methods for Multi and Single Inserts
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Jeff Davis <pgsql@j-davis.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>
Date: 2024-03-25T19:58:00Z
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
Attachments
- v14-0001-Introduce-table-modify-access-methods.patch (application/x-patch) patch v14-0001
- v14-0002-Optimize-CREATE-TABLE-AS-with-multi-inserts.patch (application/x-patch) patch v14-0002
- v14-0003-Optimize-REFRESH-MATERIALIZED-VIEW-with-multi-in.patch (application/x-patch) patch v14-0003
On Sat, Mar 23, 2024 at 5:47 AM Jeff Davis <pgsql@j-davis.com> wrote: > > Comments: Thanks for looking into it. > * Do I understand correctly that CMV, RMV, and CTAS experience a > performance benefit, but COPY FROM does not? And is that because COPY > already used table_multi_insert, whereas CMV and RMV did not? Yes, that's right. COPY FROM is already optimized with multi inserts. I now have a feeling that I need to simplify the patches. I'm thinking of dropping the COPY FROM patch using the new multi insert API for the following reasons: 1. We can now remove some of the new APIs (table_multi_insert_slots and table_multi_insert_next_free_slot) that were just invented for COPY FROM. 2. COPY FROM is already optimized with multi inserts, so no real gain is expected with the new multi insert API. 3. As we are inching towards feature freeze, simplifying the patches by having only the necessary things increases the probability of getting this in. 4. The real benefit of this whole new multi insert API is seen if used for the commands CMV, RMV, CTAS. These commands got faster by 62.54%, 68.87%, 74.31% or 2.67, 3.21, 3.89 times respectively. 5. This leaves with really simple APIs. No need for callback stuff for dealing with indexes, triggers etc. as CMV, RMV, CTAS cannot have any of them. The new APIs are more extensible, memory management is taken care of by AM, and with TableModifyState as the structure name and more meaningful API names. The callback for triggers/indexes etc. aren't taken care of as I'm now only focusing on CTAS, CMV, RMV optimizations. Please see the attached v14 patches. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com