Let table AM insertion methods control index insertion
Alexander Korotkov <akorotkov@postgresql.org>
Let table AM insertion methods control index insertion Previously, the executor did index insert unconditionally after calling table AM interface methods tuple_insert() and multi_insert(). This commit introduces the new parameter insert_indexes for these two methods. Setting '*insert_indexes' to true saves the current logic. Setting it to false indicates that table AM cares about index inserts itself and doesn't want the caller to do that. Discussion: https://postgr.es/m/CAPpHfdurb9ycV8udYqM%3Do0sPS66PJ4RCBM1g-bBpvzUfogY0EA%40mail.gmail.com Reviewed-by: Pavel Borisov, Matthias van de Meent, Mark Dilger
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +3 −1 |
| src/backend/access/heap/heapam_handler.c | modified | +3 −1 |
| src/backend/access/table/tableam.c | modified | +4 −2 |
| src/backend/catalog/indexing.c | modified | +3 −1 |
| src/backend/commands/copyfrom.c | modified | +9 −4 |
| src/backend/commands/createas.c | modified | +3 −1 |
| src/backend/commands/matview.c | modified | +3 −1 |
| src/backend/commands/tablecmds.c | modified | +5 −1 |
| src/backend/executor/execReplication.c | modified | +4 −2 |
| src/backend/executor/nodeModifyTable.c | modified | +4 −2 |
| src/include/access/heapam.h | modified | +1 −1 |
| src/include/access/tableam.h | modified | +18 −7 |
Discussion
- Table AM Interface Enhancements 104 messages · 2023-11-23 → 2024-06-22