From: Michel SALAIS <msalais@msym.fr>
To: 'Julien Rouhaud' <rjuju123@gmail.com>
Cc: 'postgres performance list' <pgsql-performance@postgresql.org>
Subject: RE: sql execution time in pg_stat_statements
Date: Fri, 10 Sep 2021 19:12:48 +0200
Message-ID: <007201d7a667$1516d860$3f448920$@msym.fr> (raw)
In-Reply-To: <CAOBaU_Zn5V7vsFaTZKjJgFCb5hQPAQNqV1ro-Kw-VE9n5zBzVQ@mail.gmail.com>
References: <005f01d7a5a6$67784b50$3668e1f0$@msym.fr>
<006601d7a5ab$6e01c780$4a055680$@msym.fr>
<CAOBaU_Zn5V7vsFaTZKjJgFCb5hQPAQNqV1ro-Kw-VE9n5zBzVQ@mail.gmail.com>
-----Message d'origine-----
De : Julien Rouhaud <rjuju123@gmail.com>
Envoyé : vendredi 10 septembre 2021 07:18
À : Michel SALAIS <msalais@msym.fr>
Cc : postgres performance list <pgsql-performance@postgresql.org>
Objet : Re: sql execution time in pg_stat_statements
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.
--------------------------------------------------------------------------------
Hi,
I thaught that total_time (total_exec_time + total_plan_time) included I/O but when we have blk_read_time + blk_write_time equals several times total_time it is difficult to continue to think that...
So What is really total_time (total_exec_time + total_plan_time) ?
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: msalais@msym.fr, rjuju123@gmail.com
Subject: RE: sql execution time in pg_stat_statements
In-Reply-To: <007201d7a667$1516d860$3f448920$@msym.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox