Re: too much pgbench init output

From: "Tomas Vondra" <tv(at)fuzzy(dot)cz>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: too much pgbench init output
Date: 2012-09-01 20:10:00
Message-ID: d23770415847dc022c2e65e8fd25399a.squirrel@sq.gransy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1 Září 2012, 12:30, Robert Haas wrote:
> On Sat, Sep 1, 2012 at 12:00 AM, Peter Eisentraut <peter_e(at)gmx(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-09-01 21:11:23 Re: [HACKERS] Date conversion using day of week
Previous Message Bruce Momjian 2012-09-01 19:47:14 Re: Yet another failure mode in pg_upgrade