postgresql/src/backend/access
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
..
brin Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
common Revert: Custom reloptions for table AM 2024-04-11 15:46:35 +03:00
gin Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
gist Merge prune, freeze and vacuum WAL record formats 2024-03-25 14:59:58 +02:00
hash Fix inconsistency with replay of hash squeeze record for clean buffers 2024-04-11 09:20:51 +09:00
heap Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
index Add missing index_insert_cleanup calls 2024-04-19 16:08:34 +02:00
nbtree Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
rmgrdesc Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
sequence Fix comment thinko in sequence.c 2024-02-27 08:19:39 +09:00
spgist Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
table revert: Generalize relation analyze in table AM interface 2024-04-16 13:14:20 +03:00
tablesample Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
transam Refactoring for CommitTransactionCommand()/AbortCurrentTransaction() 2024-04-18 00:29:53 +03:00
Makefile Introduce sequence_*() access functions 2024-02-26 16:04:59 +09:00
meson.build Introduce sequence_*() access functions 2024-02-26 16:04:59 +09:00