Re: Vectorize pg_visibility.pg_visibility_map_summary - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Vectorize pg_visibility.pg_visibility_map_summary
Date
Msg-id CAD21AoD65DNzZ-RUFFhayd21BPH5Uvsgsve=CX+k1+1-VQqWVw@mail.gmail.com
Whole thread Raw
In response to Vectorize pg_visibility.pg_visibility_map_summary  (Matthias van de Meent <boekewurm+postgres@gmail.com>)
Responses Re: Vectorize pg_visibility.pg_visibility_map_summary
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: psql: Fix tab completion for VACUUM option values
Next
From: Matthias van de Meent
Date:
Subject: Re: Vectorize pg_visibility.pg_visibility_map_summary