Skip to content

"# of events" in "Wait events for all databases" or "Wait events for all queries" tables appears to be wrong on server restart #272

@mbanck-cd

Description

@mbanck-cd

The aggregated number of events for a whole database or particular queries appears to be wrong when the server gets restarted (or the pg_wait_sampling data gets otherwise reset, e.g. via pg_wait_sampling_reset_profile(), see powa-team/powa#178).

The numbers appear to high for me, but it is a bit difficult to generate a reproducer. The problem is likely the max(count) - min(count) here:

LOG:  statement: SELECT srvid, queryid, ps.query, event_type, event, sum(count) AS counts
                    FROM (
                    SELECT srvid, queryid, dbid, datname, event_type, event,
            max(count) - min(count) AS count
            FROM
          public.powa_databases,
          LATERAL
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions