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: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Per backend relation statistics tracking
Date: 2025-08-26 06:15:28
Message-ID: aK1RABxt3iIYU7Sm@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 Mon, Aug 25, 2025 at 07:22:43PM -0500, Sami Imseih wrote:
> > Adding these fields to the backend level stats spread based on the
> > backend PID without the knowledge of the relation they're related with
> > makes it much less interesting IMO, because we lose a lot of
> > granularity value that we have with the pg_statio_* relations, at the
> > cost of more bloat, particularly if these numbers are distributed
> > across many relations.
>
> I think the flip side of the argument is that the current per-table metrics
> don't tell us which of our backends ( by user, application_name )
> are contributing to a specific type of activity.
> Would it be interesting to try to answer a question such as
> "Does application_name = AppA perform more sequential scans than AppB?"
> or "does UserA perform more index scans than UserB?"

Right. I think we can see the relations as the "destinations" of the activity
and the backends as the "source" of it. Tracking both sides help to visualize
the activity from different angles.

Regards,

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2025-08-26 06:26:53 Re: Potential problem in commit f777d773878 and 4f7f7b03758
Previous Message Bertrand Drouvot 2025-08-26 06:12:17 Re: Per backend relation statistics tracking