Re: Per backend relation statistics tracking

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Per backend relation statistics tracking
Date: 2025-08-28 16:05:12
Message-ID: aLB+OLNmXCCnRg3p@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Aug 27, 2025 at 01:57:13PM +0000, Bertrand Drouvot wrote:
> Hi,
>
> On Tue, Aug 26, 2025 at 04:55:09PM -0500, Sami Imseih wrote:
> > I worry that a single view will grow very wide, and we will have to eventually
> > split it. So we may as well start thinking about having multiple views
> > in advance.
>
> I gave it more thoughts and I now think that multiple views is better. We
> could start with pg_stat_backend_relations here.
>

PFA v3, using pg_stat_backend_relation instead of pg_stat_backend.

In passing, adding PGDLLIMPORT for backend_has_relstats and PendingBackendStats
that were missing in v2.

As compared to v1, only 0001 and 0002 are shared. Let's discuss those first before
moving foward with 0003+.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v3-0001-Adding-per-backend-relation-statistics-tracking.patch text/x-diff 6.6 KB
v3-0002-Adding-the-pg_stat_backend_relation-view.patch text/x-diff 11.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-08-28 16:07:40 Re: Adding per backend commit and rollback counters
Previous Message Fabrice Chapuis 2025-08-28 15:41:18 Re: Issue with logical replication slot during switchover