Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbZkJ-002fxM-0x for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jun 2026 08:11:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wbZkI-0051so-0g for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jun 2026 08:11:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wbZkH-0051sg-2i for pgsql-hackers@lists.postgresql.org; Mon, 22 Jun 2026 08:11:05 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wbZkF-00000001ivR-1sO7 for pgsql-hackers@postgresql.org; Mon, 22 Jun 2026 08:11:05 +0000 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-2c6c101aeafso24986965ad.0 for ; Mon, 22 Jun 2026 01:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782115860; x=1782720660; darn=postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=t/t7C62L+ZepJ1KDJ8m+XQO6L0G556Vvw5M4F1J+yBI=; b=L6asMvcb90Gqs394Ab7r+faDaVLXLDKzO7tT/iDX4WLGHGwWn/VOMgP0YCa1uXopQq 3vVv/9nRdWYxNBNMLMD6Yt5U/LFaUc2o40O9ahroRXjsxt2f5f7aLu07UAW+1UAgPavJ idogghZsok4cdNseIxB+IB7rSrO+27ABuqKpYfsfbrd+G+D6p3vhph4Pn9T6ce0fUt12 tbKRB9i0YXlZ8pETfFz7c6ow23bmyLVlDF4LsQzf5rDTnsFiGpMwV36dmM2tEJ+U2xkX AQwmKYVKnmkkI0+2Coj3K5nTNPjF4SNQXSQDtPMhwoRvSoH8N/NMjKk4gYYPEhoUTtBn 9RWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782115860; x=1782720660; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t/t7C62L+ZepJ1KDJ8m+XQO6L0G556Vvw5M4F1J+yBI=; b=Pq2cUzdzYnGC8zeSu257y7U7I7MxlnfXgSoiANycquZtOQCyCGK0AhGn53Ecc3HDPE FaCXAGx91ef7LbzouA6utkqmDcHJ8aPm2OkYgmCxK8GqcOJeyy0P3YG4AvU9NwziHUvf QSJiM5AOrxChGZba1V/TFmJGw9LdPIYAsw21nnur5I2bhCR9I2ouCRx4XU7un/rrUnHP CXE0FeXxWb08/NhxSKkD/CPVID7d9MNnbGsphNpBaILQb1hpeBExXIVoTUjAY81D0b22 awrRaUfyUv4gtnbnDM5AV939XaNaogRUZEH5Nr2LwFzUdw9QqR3PJqxOmX9bcCj1k9x+ WZMQ== X-Forwarded-Encrypted: i=1; AHgh+RogtTij81tSLybl6uRKJCFL4hU5uDO39K+YoBr/MZwGYfKQmiLw4A9KnT4rh6BvTqPTgWGPSrz1TBYrrv+/@postgresql.org X-Gm-Message-State: AOJu0YyivUix8iNizc21E+docq1yK9txDZNJXuwUuyjwjzYCSbj+VFl8 0BCgSQAHJ0GkXvXe2Pr7Z4u+XlksiWmY2OolbtfUSL7fgAv6BfPOR8YM6LYnSAlQ X-Gm-Gg: AfdE7clED8Dcjzvv4vlpL2hftRzNUCIzIBAYjG+YXLBfnQOTOwGo5F/Tw7Lu1L+G6Zo keKO46j4ShXJWBiu2u2sAzGxj99tT7dtukeU6m9IhTwPJGOMXWSEwIL3YZu3PADr7T1CutzSuDx QPz9ky2KMhJv1Sa3mQW9B52Wq/lbJyUKKWCe4UF6ubZm43OF+16Wopn+OkSn4/QgzbSCejXKCb7 KXRSGdoOh85zQX4cSOGRy2hOJXPmlkkvDLRJRZ+Fr5OUt5/CfsN07ajfo1hcaM7lOJwBrKTcCn1 iBrVz1i4yBF43rXm3D97YM0iJ2lJ/h9a9ykQznqYRLVWB8IORDO1KtXM3Xi9yi8UxzDwE6lw5j6 txKO+J0y+t/HT04n9kMTwQZLaHX17nznDxozjrEuGuNMG1FpnBSQYc5uANgiqPgxxLABc5V19Aq c3Uqxvz1B++cqFfAYHpAyS1w== X-Received: by 2002:a17:902:ec83:b0:2bf:23ad:8595 with SMTP id d9443c01a7336-2c718f1f044mr132829365ad.4.1782115860323; Mon, 22 Jun 2026 01:11:00 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.161]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c7439f85f1sm71147155ad.42.2026.06.22.01.10.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jun 2026 01:10:58 -0700 (PDT) From: Chao Li Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_AE157C43-EC34-4777-9D04-86C524786153" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: pgbench --continue-on-error: clarify TPS and failure reporting Date: Mon, 22 Jun 2026 16:10:22 +0800 In-Reply-To: <09361838-9213-4961-95A5-A0CD4AABF2DD@gmail.com> Cc: Yugo Nagata , PostgreSQL-development , Rintaro Ikeda To: Fujii Masao References: <597C9755-4386-488D-A289-16D50AD81FBF@gmail.com> <20260618143631.25c2ed34b1d7527ee2d92a17@sraoss.co.jp> <958C5B66-50B0-47C8-BBA5-7D32F7A09566@gmail.com> <09361838-9213-4961-95A5-A0CD4AABF2DD@gmail.com> X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_AE157C43-EC34-4777-9D04-86C524786153 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jun 18, 2026, at 20:45, Chao Li wrote: >=20 >=20 >=20 >> On Jun 18, 2026, at 17:40, Fujii Masao wrote: >>=20 >> On Thu, Jun 18, 2026 at 3:25=E2=80=AFPM Chao Li = wrote: >>> Thanks for confirming the doc issue. The here comes a small doc = patch. >>>=20 >>> I also noticed there is a later paragraph about =E2=80=9Clatency=E2=80= =9D that also needs an update, it=E2=80=99s included in the patch as = well. >>=20 >> Thanks for the patch! The TPS-related changes look good to me. >>=20 >> The latency of a successful transaction includes the entire time of >> - transaction execution with rollbacks and retries. The latency is = measured >> - only for successful transactions and commands but not for failed >> transactions >> - or commands. >> + transaction execution with rollbacks and retries. The latency is = measured >> + only for successful transactions and commands, except that failed >> + transactions are included in the simple average latency when the >> + option is used. >>=20 >> It doesn't seem that the behavior of the latency average in the main >> report depends on --continue-on-error itself. Instead, when neither >> --progress, --rate, nor --latency-limit is specified, the main >> report shows a simple latency average computed as the total benchmark >> duration divided by the number of successful and failed transactions, >> so failed transactions are included. >>=20 >> On the other hand, when any of those options is specified, the >> latency average and latency stddev in the main report are based >> only on successful transactions. Likewise, the per-script and >> per-command latency statistics are measured only for successful >> transactions and commands. >>=20 >> So how about something like this instead? >>=20 >> ------------------------------- >> >> The latency of a successful transaction includes the entire time of >> - transaction execution with rollbacks and retries. The simple >> - latency average shown in the main report is = computed from >> - the total benchmark duration divided by both successful and = failed >> - transactions, and therefore includes failed transactions. In = contrast, >> - detailed latency statistics, including the per-script and = per-command >> - reports, are measured only for successful transactions and = commands, not >> - for failed transactions or commands. >> + transaction execution with rollbacks and retries. In the main = report, when >> + neither , , nor >> + is specified, the >> + latency average is computed from the total = benchmark >> + duration divided by both successful and failed transactions, and = therefore >> + includes failed transactions. Otherwise, the latency >> average >> + and latency stddev shown in the main report = are measured >> + only for successful transactions. Detailed latency statistics, = including >> + the per-script and per-command reports, are also measured only = for >> + successful transactions and commands, not for failed transactions = or >> + commands. >> >> ------------------------------- >>=20 >=20 > I feel that might be too detailed. Listing these three option names = here could make the doc harder to read and maintain. When failures are = included, the output line already says so explicitly: > ``` > latency average =3D 0.387 ms (including failures) > ``` >=20 > Can we simply say something like this? > ``` > > The latency of a successful transaction includes the entire time of > transaction execution with rollbacks and retries. The latency is = measured > only for successful transactions and commands, not for failed = transactions > or commands, unless the report explicitly says that it includes = failures. > > ``` >=20 > Best regards, > -- > Chao Li (Evan) > HighGo Software Co., Ltd. > https://www.highgo.com/ Thinking it over, I came up with a version that combines Fujii-san=E2=80=99= s suggestion and my previous version: ``` The latency of a successful transaction includes the entire time of transaction execution with rollbacks and retries. In the main = report, when none of , , = and is specified, latency = average is computed from both successful and failed transactions. In such = cases, this is explicitly indicated by (including = failures). Other latency statistics, including the per-script and per-command = reports, are measured only for successful transactions and commands, not for = failed transactions or commands. ``` PFA v2. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/ --Apple-Mail=_AE157C43-EC34-4777-9D04-86C524786153 Content-Disposition: attachment; filename=v2-0001-doc-Clarify-pgbench-reporting-with-continue-on-er.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="v2-0001-doc-Clarify-pgbench-reporting-with-continue-on-er.patch" Content-Transfer-Encoding: quoted-printable =46rom=200a944fb519d8eeb74037dccbf3cf5f40ce613180=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20"Chao=20Li=20(Evan)"=20=0A= Date:=20Thu,=2018=20Jun=202026=2014:21:13=20+0800=0ASubject:=20[PATCH=20= v2]=20doc:=20Clarify=20pgbench=20reporting=20with=20--continue-on-error=0A= =0AClarify=20that=20transactions=20failed=20under=20--continue-on-error=20= are=20reported=0Aseparately=20and=20are=20not=20counted=20as=20= transactions=20actually=20processed=20or=20in=0ATPS.=20Also=20adjust=20= the=20latency=20description=20to=20avoid=20implying=20that=20failed=0A= transactions=20are=20generally=20included=20in=20latency=20measurements.=0A= =0AAuthor:=20Chao=20Li=20=0AReviewed-by:=20Yugo=20Nagata=20= =0AReviewed-by:=20Fujii=20Masao=20= =0ADiscussion:=20= https://postgr.es/m/597C9755-4386-488D-A289-16D50AD81FBF@gmail.com=0A---=0A= =20doc/src/sgml/ref/pgbench.sgml=20|=2016=20++++++++++++----=0A=201=20= file=20changed,=2012=20insertions(+),=204=20deletions(-)=0A=0Adiff=20= --git=20a/doc/src/sgml/ref/pgbench.sgml=20= b/doc/src/sgml/ref/pgbench.sgml=0Aindex=202e401d1ceb8..7619b8ad743=20= 100644=0A---=20a/doc/src/sgml/ref/pgbench.sgml=0A+++=20= b/doc/src/sgml/ref/pgbench.sgml=0A@@=20-770,10=20+770,13=20@@=20pgbench=20= =20options=20=20= d=0A=20=20=20=20=20=20=20=20=20the=20connection=20to=20= fail.=0A=20=20=20=20=20=20=20=20=20See=20=20for=20more=20information.=0A=20=20=20= =20=20=20=20=20=0A+=0A=20=20=20=20=20=20=20=20=0A=20=20=20=20= =20=20=20=20=20This=20option=20is=20useful=20when=20your=20custom=20= script=20may=20raise=20errors=0A=20=20=20=20=20=20=20=20=20such=20as=20= unique=20constraint=20violations,=20but=20you=20want=20the=20benchmark=0A= -=20=20=20=20=20=20=20=20to=20continue=20and=20measure=20performance=20= including=20those=20failures.=0A+=20=20=20=20=20=20=20=20to=20continue=20= despite=20individual=20statement=20failures.=20=20Failed=0A+=20=20=20=20=20= =20=20=20transactions=20are=20reported=20separately,=20but=20are=20not=20= counted=20as=0A+=20=20=20=20=20=20=20=20transactions=20actually=20= processed,=20nor=20are=20they=20included=20in=20TPS.=0A=20=20=20=20=20=20= =20=20=0A=20=20=20=20=20=20=20=0A=20=20=20=20=20=20= =0A@@=20-2933,9=20+2936,14=20@@=20statement=20latencies=20= in=20milliseconds,=20failures=20and=20retries:=0A=20=0A=20=20=20=0A= =20=20=20=20The=20latency=20of=20a=20successful=20transaction=20includes=20= the=20entire=20time=20of=0A-=20=20=20transaction=20execution=20with=20= rollbacks=20and=20retries.=20The=20latency=20is=20measured=0A-=20=20=20= only=20for=20successful=20transactions=20and=20commands=20but=20not=20= for=20failed=20transactions=0A-=20=20=20or=20commands.=0A+=20=20=20= transaction=20execution=20with=20rollbacks=20and=20retries.=20=20In=20= the=20main=20report,=0A+=20=20=20when=20none=20of=20= ,=20,=20and=0A+=20=20=20= =20is=20specified,=20latency=20= average=0A+=20=20=20is=20computed=20from=20both=20successful=20= and=20failed=20transactions.=20=20In=20such=20cases,=0A+=20=20=20this=20= is=20explicitly=20indicated=20by=20(including=20= failures).=0A+=20=20=20Other=20latency=20statistics,=20= including=20the=20per-script=20and=20per-command=20reports,=0A+=20=20=20= are=20measured=20only=20for=20successful=20transactions=20and=20= commands,=20not=20for=20failed=0A+=20=20=20transactions=20or=20commands.=0A= =20=20=20=0A=20=0A=20=20=20=0A--=20=0A2.50.1=20(Apple=20= Git-155)=0A=0A= --Apple-Mail=_AE157C43-EC34-4777-9D04-86C524786153--