Re: psql \watch versus \timing - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql \watch versus \timing
Date
Msg-id 10853.1369002832@sss.pgh.pa.us
Whole thread Raw
In response to psql \watch versus \timing  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: psql \watch versus \timing  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Jeff Janes <jeff.janes@gmail.com> writes:
> I'd like to run same query repeatedly and see how long it takes each time.
> I thought \watch would be excellent for this, but it turns out that using
> \watch suppresses the output of \timing.

> Is this intentional, or unavoidable?

\watch uses PSQLexec not SendQuery; the latter implements \timing which
I agree is arguably useful here, but also autocommit/auto-savepoint
behavior which probably isn't a good idea.

It might be a good idea to refactor those two routines into one routine
with some sort of bitmap flags argument to control the various add-on
behaviors, but that seems like not 9.3 material anymore.

> Also, is it just or does the inability to watch more frequently than once a
> second make it a lot less useful than it could be?

It did not seem that exciting to me.  In particular, we've already found
out that \watch with zero delay is a pretty bad idea, so you'd have to
make a case for what smaller minimum to use if it's not to be 1 second.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: psql \watch versus \timing
Next
From: Chris Farmiloe
Date:
Subject: ASYNC Privileges proposal