pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Tatsuo Ishii <ishii@postgresql.org>
Cc: pgsql-release@lists.postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: Fix for Extra Parenthesis in pgbench progress message
Date: Fri, 07 Feb 2025 12:58:38 -0500
Message-ID: <1456496.1738951118@sss.pgh.pa.us> (raw)
In-Reply-To: <4k4drkh7bcmdezq6zbkhp25mnrzpswqi2o75d5uv2eeg3aq6q7@b7kqdmzzwzgb>
References: <85fe426d-248a-47f7-8784-22af811ee572@oss.nttdata.com>
	<20241108.114713.484828673471024549.ishii@postgresql.org>
	<95f1100e-e59b-41b7-a406-f865c2e69db7@oss.nttdata.com>
	<20241125.083155.1820744655877715597.ishii@postgresql.org>
	<ffc99be5-e418-40ee-91d6-62c3deb42918@oss.nttdata.com>
	<4k4drkh7bcmdezq6zbkhp25mnrzpswqi2o75d5uv2eeg3aq6q7@b7kqdmzzwzgb>

Andres Freund <andres@anarazel.de> writes:
> I just did pgbench -i 100 -q via ssh and noticed it was *way* slower than I
> expected.  Did it with debian's pgbench, no such issue.

> It's due to this patch.

Oh!  The problem is that the hunk

+       /*
+        * If the previous progress message is longer than the current one,
+        * add spaces to the current line to fully overwrite any remaining
+        * characters from the previous message.
+        */
+       if (prev_chars > chars)
+           fprintf(stderr, "%*c", prev_chars - chars, ' ');
+       fputc(eol, stderr);
+       prev_chars = chars;

is executed unconditionally for each data row, when we should only run
it when we printed something.  It's kind of invisible if "eol" is \r,
but I can believe that it's driving the terminal nuts.  Trying it
here, it also makes the thing practically unresponsive to control-C.

> Given the upcoming set of minor releases, I think it may be best for this this
> patch ought to be reverted for now.

Seems easy enough to fix.  But it's now middle of the night Saturday
morning in Japan, so I doubt Masao-san or Ishii-san will see this
for awhile.  And the release freeze is coming up fast.

Let me have a go at fixing it, and if it turns out to be harder
than I think, I'll revert it instead.

			regards, tom lane





view thread (24+ messages)  latest in thread

Message-ID: <1456496.1738951118@sss.pgh.pa.us>
Permalink:  ../1456496.1738951118@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1456496.1738951118@sss.pgh.pa.us

 · 

reply

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, masao.fujii@oss.nttdata.com, ishii@postgresql.org, pgsql-release@lists.postgresql.org
  Subject: Re: Fix for Extra Parenthesis in pgbench progress message
  In-Reply-To: <1456496.1738951118@sss.pgh.pa.us>

* 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