git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 95d14b7) | patch
Add missing index_insert_cleanup calls
2024年4月19日 13:47:48 +0000 (15:47 +0200)
2024年4月19日 14:08:34 +0000 (16:08 +0200)
commit 41d2c6f952edc4841763d05296b65f3c0edad4f2
Add missing index_insert_cleanup calls

The optimization for inserts into BRIN indexes added by c1ec02be1d79
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
doc/src/sgml/indexam.sgml diff | blob | blame | history
src/backend/access/brin/brin.c diff | blob | blame | history
src/backend/access/index/indexam.c diff | blob | blame | history
src/backend/catalog/index.c diff | blob | blame | history
src/backend/commands/constraint.c diff | blob | blame | history
src/include/access/amapi.h diff | blob | blame | history
src/include/access/brin_internal.h diff | blob | blame | history
src/test/regress/expected/brin.out diff | blob | blame | history
src/test/regress/sql/brin.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /