Re: Fix for Extra Parenthesis in pgbench progress message
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>, Tatsuo Ishii <ishii@postgresql.org>, pgsql-release@lists.postgresql.org,
pgsql-hackers@postgresql.org
Date: 2025-02-07T18:11:16Z
Lists: pgsql-hackers
Hi, On 2025-02-07 12:58:38 -0500, Tom Lane wrote: > 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. Yea, that would do it. > Trying it here, it also makes the thing practically unresponsive to > control-C. Interestingly I don't see that aspect... > > 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. Makes sense! Greetings, Andres Freund
Commits
-
Fix pgbench performance issue induced by commit af35fe501.
- b6decfc1d22b 13.19 landed
- 5addea71c7c7 14.16 landed
- 499d1cf55d3d 15.11 landed
- fb056564ec5b 18.0 landed
- e35d396ec354 17.3 landed
- 21b815f92e82 16.7 landed
-
pgbench: Ensure previous progress message is fully cleared when updating.
- f1cb5e51f329 13.19 landed
- 0f13e1a78b14 14.16 landed
- 1e46f7351abc 15.11 landed
- 1cf646957135 16.7 landed
- adb103fcacdd 17.3 landed
- af35fe501af5 18.0 landed