Re: sql execution time in pg_stat_statements - Mailing list pgsql-performance

From Julien Rouhaud
Subject Re: sql execution time in pg_stat_statements
Date
Msg-id CAOBaU_Zn5V7vsFaTZKjJgFCb5hQPAQNqV1ro-Kw-VE9n5zBzVQ@mail.gmail.com
Whole thread Raw
In response to RE: sql execution time in pg_stat_statements  ("Michel SALAIS" <msalais@msym.fr>)
Responses RE: sql execution time in pg_stat_statements  ("Michel SALAIS" <msalais@msym.fr>)
List pgsql-performance
On Fri, Sep 10, 2021 at 2:49 AM Michel SALAIS <msalais@msym.fr> wrote:
>
> I think that total_time in pg_stat_statements is cpu time + possible waits. So, can I say that:
>
> Total_sql_time = total_time + blk_read_time + blk_write_time
>
> Documentation is not clear at all on that.

In version 12 and below, total_time is the elapsed time between the
execution start and stop, so it includes all underlying events. That
includes any IO activity, wait events or nested statements (if
pg_stat_statemetns.track is set to all).  This corresponds to the new
total_exec_time field in version 13 and later.


> Just to say that for PostgreSQL 13, total_time is replaced by “total_exec_time + total_plan_time”

Indeed, as this version also tracks planning activity.



pgsql-performance by date:

Previous
From: "Michel SALAIS"
Date:
Subject: RE: sql execution time in pg_stat_statements
Next
From: Ranier Vilela
Date:
Subject: Re: PostgreSql 9.4 Database connection failure