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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b1484a3f1910bfd0e254afe40085dfc3351bda8c
Modified Files
--------------
src/backend/access/heap/heapam.c | 4 +++-
src/backend/access/heap/heapam_handler.c | 4 +++-
src/backend/access/table/tableam.c | 6 ++++--
src/backend/catalog/indexing.c | 4 +++-
src/backend/commands/copyfrom.c | 13 +++++++++----
src/backend/commands/createas.c | 4 +++-
src/backend/commands/matview.c | 4 +++-
src/backend/commands/tablecmds.c | 6 +++++-
src/backend/executor/execReplication.c | 6 ++++--
src/backend/executor/nodeModifyTable.c | 6 ++++--
src/include/access/heapam.h | 2 +-
src/include/access/tableam.h | 25 ++++++++++++++++++-------
12 files changed, 60 insertions(+), 24 deletions(-)