Re: Missing wait events (gap analysis)

From: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
To: Nikolay Samokhvalov <nik(at)postgres(dot)ai>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Kirk Wolak <wolakk(at)gmail(dot)com>, Andrey Borodin <amborodin(at)acm(dot)org>, aekorotkov(at)gmail(dot)com
Subject: Re: Missing wait events (gap analysis)
Date: 2025-11-24 17:05:34
Message-ID: CAEze2WjX1u9nkw4isTKJJ5ZY00CvNgRCAKbmPfK40DRgeKihaQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 22 Nov 2025 at 01:43, Nikolay Samokhvalov <nik(at)postgres(dot)ai> wrote:
>
> Hi hi
>
> Many tools that implement wait event analysis, when visualizing samples with "wait_event is null" use green color and "CPU" (perhaps, it started with RDS Performance Insights and PASH Viewer and, I suppose, originally came from the Oracle world, and now I see it in many more places).
>
> I don't have any concerns with green color, but always had a feeling that "coalesce(wait_event, 'CPU')" is an assumption that can make analysis inaccurate, because there may be a lot of places in the code that are not covered by wait events, but technically should -- and such places cannot be named "CPU".

Then, isn't that an issue with the reporting tool(s)?

> I asked Claude Code to analyze Postgres source code and find such places, that we could potentially cover with more wait events. Here is the first result: https://github.com/NikolayS/postgres/blob/claude/cpu-asterisk-wait-events-01CyiYYMMcFMovuqPqLNcp8T/WAIT_EVENTS_ANALYSIS.md

Did you review this yourself, and include only those places that are
actually relevant for wait events? I'm not opposed to using AI systems
for analysis, for understanding the code, or for finding issues, but
posting tool output without you first understanding all the proposed
changes is a recipe for wasting everyone's time.

> Before moving forward with proposals of specific patches, I wanted to hear opinions -- does it make sense to work in this direction?

I don't think it's a bad idea to add wait events in potential wait
points in code.

Kind regards,

Matthias van de Meent
Databricks (https://www.databricks.com)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-11-24 17:08:24 Re: Extended test coverage and docs for SSL passphrase commands
Previous Message Fabrice Chapuis 2025-11-24 17:00:08 Re: Issue with logical replication slot during switchover