Re: too much pgbench init output - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: too much pgbench init output
Date
Msg-id d23770415847dc022c2e65e8fd25399a.squirrel@sq.gransy.com
Whole thread Raw
In response to Re: too much pgbench init output  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 1 Září 2012, 12:30, Robert Haas wrote:
> On Sat, Sep 1, 2012 at 12:00 AM, Peter Eisentraut <peter_e@gmx.net> wrote:
>> When initializing a large database, pgbench writes tons of "%d tuples
>> done" lines.  I propose to change this to a sort of progress counter
>> that stays on the same line, as in the attached patch.
>
> I'm not sure I like this - what if the output is being saved off to a
> file?

What about using istty(stdout) to handle this situation? Although I find
it usually confusing, because it prints one thing when executed directly
and something else when the output is redirected to a file.

I see two other options:

(1) removing this output altogether (I can't imagine a situation when this
really matters) and replace it with a simple "inserted 23% of rows,
estimated remaining time 14:23 (863 sec)", updated each 1%

(2) adding a switch (--verbose) that enables these lines, don't print them
by default

Another option might be updating the process title so that the "top" shows
current progress more precisely than (1).

Tomas




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Yet another failure mode in pg_upgrade
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] Date conversion using day of week