postgresql/src
Tom Lane fb056564ec Fix pgbench performance issue induced by commit af35fe501.
Commit af35fe501 caused "pgbench -i" to emit a '\r' character
for each data row loaded (when stderr is a terminal).
That's effectively invisible on-screen, but it causes the
connected terminal program to consume a lot of cycles.
It's even worse if you're connected over ssh, as the data
then has to pass through the ssh tunnel.

Simplest fix is to move the added logic inside the if-tests
that check whether to print a progress line.  We could do
it another way that avoids duplicating these few lines,
but on the whole this seems the most transparent way to
write it.

Like the previous commit, back-patch to all supported versions.

Reported-by: Andres Freund <andres@anarazel.de>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://postgr.es/m/4k4drkh7bcmdezq6zbkhp25mnrzpswqi2o75d5uv2eeg3aq6q7@b7kqdmzzwzgb
Backpatch-through: 13
2025-02-07 13:41:42 -05:00
..
backend Allow non-btree speculative insertion indexes 2025-02-07 11:23:34 +01:00
bin Fix pgbench performance issue induced by commit af35fe501. 2025-02-07 13:41:42 -05:00
common Add support for Unicode case folding. 2025-01-23 09:06:50 -08:00
fe_utils Fix grammatical typos around possessive "its" 2025-01-29 14:39:14 +07:00
include Virtual generated columns 2025-02-07 09:46:59 +01:00
interfaces libpq: Handle asynchronous actions during SASL 2025-02-06 22:19:21 +01:00
makefiles Update copyright for 2025 2025-01-01 11:21:55 -05:00
pl Virtual generated columns 2025-02-07 09:46:59 +01:00
port Avoid breaking SJIS encoding while de-backslashing Windows paths. 2025-01-29 14:24:36 -05:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test Virtual generated columns 2025-02-07 09:46:59 +01:00
timezone Update time zone data files to tzdata release 2025a. 2025-01-20 16:49:15 -05:00
tools Convert strategies to and from compare types 2025-02-02 10:26:04 +01:00
tutorial Doc: simplify the tutorial's window-function examples. 2025-01-21 14:43:21 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Convert sepgsql tests to TAP 2025-01-24 12:39:47 +01:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00