Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOk5D-0004JC-Sd for pgsql-performance@arkaria.postgresql.org; Fri, 10 Sep 2021 17:12:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mOk5C-0002Q9-Q5 for pgsql-performance@arkaria.postgresql.org; Fri, 10 Sep 2021 17:12:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOk5C-0002Q1-Hk for pgsql-performance@lists.postgresql.org; Fri, 10 Sep 2021 17:12:58 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOk56-0008Me-6T for pgsql-performance@postgresql.org; Fri, 10 Sep 2021 17:12:58 +0000 Received: from ANAT ([78.197.128.121]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.184]) with ESMTPSA (Nemesis) id 1M8xwu-1mKsSd1UyU-006BH9; Fri, 10 Sep 2021 19:12:49 +0200 From: "Michel SALAIS" To: "'Julien Rouhaud'" Cc: "'postgres performance list'" References: <005f01d7a5a6$67784b50$3668e1f0$@msym.fr> <006601d7a5ab$6e01c780$4a055680$@msym.fr> In-Reply-To: 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> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJfVqXLzTD3tJt7ImS9sFGS32Fv3QH0n7V9AjP2INCqbNeR0A== Content-Language: fr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List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk -----Message d'origine----- De : Julien Rouhaud =20 Envoy=C3=A9 : vendredi 10 septembre 2021 07:18 =C3=80 : Michel SALAIS Cc : postgres performance list Objet : Re: sql execution time in pg_stat_statements On Fri, Sep 10, 2021 at 2:49 AM Michel SALAIS wrote: > > I think that total_time in pg_stat_statements is cpu time + possible = waits. So, can I say that: > > Total_sql_time =3D 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 = =E2=80=9Ctotal_exec_time + total_plan_time=E2=80=9D 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) ?