Hi, With PG16, we got Index AM -level indications for summarizing indexes, improving HOT applicability.
Given that these indexes explicitly never store TIDs and thus don't really need the cleanup part of vacuum's index cleanup, we could well decide to not count those indexes to the indexes we need to clean up in the index scan phase of vacuum, thus allowing tables with only summarizing indexes to use the single-scan option of vacuum. As a summarizing index may still want to do some housekeeping during vacuum, it'd still need to get its cleanup functions called, but it'd at least save the io and WAL of the cleanup scan. Any comments/suggestions? POC patch attached. Kind regards, Matthias van de Meent Neon (https://neon.tech)
v00-0001-WIP-Optimize-VACUUM-for-tables-with-only-summari.patch
Description: Binary data