pgsql: Let table AM insertion methods control index insertion

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Let table AM insertion methods control index insertion
Date: 2024-03-30 20:54:54
Message-ID: E1rqfj4-006YS8-Ji@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2024-03-31 05:32:46 pgsql: Speed up tail processing when hashing aligned C strings
Previous Message Tom Lane 2024-03-30 17:57:24 pgsql: Add pg_basetype() function to extract a domain's base type.