postgresql/src/backend
Tomas Vondra 41d2c6f952 Add missing index_insert_cleanup calls
The optimization for inserts into BRIN indexes added by c1ec02be1d
relies on a cache that needs to be explicitly released after calling
index_insert(). The commit however failed to invoke the cleanup in
validate_index(), which calls index_insert() indirectly through
table_index_validate_scan().

After inspecting index_insert() callers, it seems unique_key_recheck()
is missing the call too.

Fixed by adding the two missing index_insert_cleanup() calls.

The commit does two additional improvements. The aminsertcleanup()
signature is modified to have the index as the first argument, to make
it more like the other AM callbacks. And the aminsertcleanup() callback
is invoked even if the ii_AmCache is NULL, so that it can decide if the
cleanup is necessary.

Author: Alvaro Herrera, Tomas Vondra
Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/202401091043.e3nrqiad6gb7@alvherre.pgsql
2024-04-19 16:08:34 +02:00
..
access Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
archive Add built-in ERROR handling for archive callbacks. 2024-04-02 22:28:11 -05:00
backup Fix unnecessary padding in incremental backups 2024-04-14 20:37:49 +02:00
bootstrap Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
catalog Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
commands Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
executor Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
foreign Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
jit Remove dead code 2024-04-17 10:48:04 +02:00
lib Revert: Implement pg_wal_replay_wait() stored procedure 2024-04-11 17:28:15 +03:00
libpq Fix check for 'outlen' return from SSL_select_next_proto() 2024-04-08 05:03:17 +03:00
main Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
nodes revert: Transform OR clauses to ANY expression 2024-04-10 02:28:09 +03:00
optimizer Use macro NUM_MERGE_MATCH_KINDS instead of '3' in MERGE code. 2024-04-19 09:40:20 +01:00
parser Use macro NUM_MERGE_MATCH_KINDS instead of '3' in MERGE code. 2024-04-19 09:40:20 +01:00
partitioning Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
po Update copyright for 2024 2024-01-03 20:49:05 -05:00
port Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
postmaster Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
regex Support C.UTF-8 locale in the new builtin collation provider. 2024-03-19 15:24:41 -07:00
replication Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
rewrite Add RETURNING support to MERGE. 2024-03-17 13:58:59 +00:00
snowball Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
statistics Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
storage Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
tcop Revert: Custom reloptions for table AM 2024-04-11 15:46:35 +03:00
tsearch Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
utils Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
.gitignore
Makefile Rework lwlocknames.txt to become lwlocklist.h 2024-03-20 11:55:20 +01:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
meson.build Remove AIX support 2024-02-28 15:17:23 +04:00
nls.mk Remove distprep 2023-11-06 15:18:04 +01:00