Re: Add pg_stat_vfdcache view for VFD cache statistics

From: Ayoub Kazar <kazarayoub2004(at)gmail(dot)com>
To: David Geier <geidav(dot)pg(at)gmail(dot)com>
Cc: KAZAR Ayoub <ma_kazar(at)esi(dot)dz>, Tomas Vondra <tomas(at)vondra(dot)me>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add pg_stat_vfdcache view for VFD cache statistics
Date: 2026-09-02 01:31:48
Message-ID: CADu+CpSyR3fnHGwTRAbULyBtxPZbkR2Y41Dd36ombAUwG4TT3g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 1, 2026 at 9:21 AM David Geier <geidav(dot)pg(at)gmail(dot)com> wrote:

> On 13.07.2026 00:44, Ayoub Kazar wrote:
>
> > I chose to keep an accurate running count of the memory footprint per
> > backend by tracking both the sizeof(Vfd) and the exact filename string
> > lengths.
> >
> > We add the string length to the total footprint when a file is opened,
> and
> > subtract it when the VFD is freed (i suppose this is not "Too much" of a
> > work done, although it's done in a bit hot place); v5 of the patch is
> > attached.
> Better use GetMemoryChunkSpace() instead of using strlen() + 1, to get
> the true allocation size.
>
That wouldn't work because filename is malloc'd and not palloc'd, which is
what GetMemoryChunkSpace() works on IIUC.
Am i correct here?

Regards,
Ayoub

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-09-02 01:32:02 Re: [PATCH] Test coverage for pg_clear_attribute_stats() null arguments
Previous Message Tom Lane 2026-09-02 01:22:43 Re: foreign_key test is sensitive to the OID counter