Hi,
On Mon, Dec 22, 2025 at 1:28 PM Matthias van de Meent
<boekewurm+postgres@gmail.com> wrote:
>
> Hi,
>
> Whilst working on fixing a bug in GiST and SP-GiST's index-only scan
> systems, I noticed that pg_visibility is sometimes rather wasteful
> with the APIs which it calls into; especially now that there are more
> optimized APIs available.
>
> Here's one small patch that makes it use the visibilitymap_count() API
> for pg_visibility_map_summary(), replacing its own bespoke counting
> mechanism with the primary implementation that has vectorized
> optimizations, thus reducing the overhead of
> pg_visibility_map_summary.
>
It looks like a reasonable idea as it also simplifies the
pg_visibility_map_summary() function. I'm going to push it, barring
any objections.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com