Re: Vectorize pg_visibility.pg_visibility_map_summary

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Ants Aasma <ants(dot)aasma(at)cybertec(dot)at>
Subject: Re: Vectorize pg_visibility.pg_visibility_map_summary
Date: 2025-12-22 22:04:05
Message-ID: CAD21AoD65DNzZ-RUFFhayd21BPH5Uvsgsve=CX+k1+1-VQqWVw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Dec 22, 2025 at 1:28 PM Matthias van de Meent
<boekewurm+postgres(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthias van de Meent 2025-12-22 22:16:39 Re: Vectorize pg_visibility.pg_visibility_map_summary
Previous Message Masahiko Sawada 2025-12-22 21:55:59 Re: psql: Fix tab completion for VACUUM option values