Re: Metadata and record block access stats for indexes

From: Mircea Cadariu <cadariu(dot)mircea(at)gmail(dot)com>
To: Aleksander Alekseev <aleksander(at)tigerdata(dot)com>, pgsql-hackers(at)postgresql(dot)org
Cc: Frédéric Yhuel <frederic(dot)yhuel(at)dalibo(dot)com>
Subject: Re: Metadata and record block access stats for indexes
Date: 2025-11-28 15:18:02
Message-ID: 33bcd7b1-899b-415f-82bd-27f710bcc0ee@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, Aleksander!

On 20/11/2025 14:56, Aleksander Alekseev wrote:
> Hi Mircea,
>
>> Rebased and dusted off this patch.
> Thanks for the patch. Here are my two cents.
>
> IMO it would be helpful if you could come up with a few more practical
> use cases. This change is going to affect pretty much everyone. If
> only a few users will benefit from it once in several years, the value
> of the patch is arguably low. As an example, can you think of how the
> new counters can be used for debugging, checking index integrity,
> writing new access methods or perhaps writing property-based tests?
> Just several examples that came to my mind first.
>
> Also I'm a bit concerned about the performance impact. It's probably
> next to nothing, but if you could measure it on a relatively large
> amount of data that would be great. Note that it's not uncommon to
> have dozens of different indexes for a single table.
>
Thanks! It hasn't caught on, might just stay an educational exercise on
my side on patch writing and we move on. Thanks for thinking out loud,
your ideas lead me to this: when working on improving the performance of
index traversals, it could be a direct way to show improvement and even
write regression tests: lower amount of internal pages are read than
before. But, one could also just use the existing stats and still be
able to track this..

For the performance checks, indeed, I'm using this script, I observe
no meaningful difference on my laptop:
https://gist.github.com/mcadariu/fc4a6d4eccd56b4447d1d9d05f9b5d79.

--
Thanks,
Mircea Cadariu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2025-11-28 15:30:02 Re: [PoC] XMLCast (SQL/XML X025)
Previous Message Nazir Bilal Yavuz 2025-11-28 15:17:19 Re: [PATCH] Add `headerscheck` run_target to meson