You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
The optimization for inserts into BRIN indexes added byc1ec02brelies on a cache that needs to be explicitly released after callingindex_insert(). The commit however failed to invoke the cleanup invalidate_index(), which calls index_insert() indirectly throughtable_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 makeit more like the other AM callbacks. And the aminsertcleanup() callbackis invoked even if the ii_AmCache is NULL, so that it can decide if thecleanup is necessary.Author: Alvaro Herrera, Tomas VondraReported-by: Alexander LakhinDiscussion:https://postgr.es/m/202401091043.e3nrqiad6gb7@alvherre.pgsql