timing information for switching database

Started by Zhihong Yuover 3 years ago3 messages
#1Zhihong Yu
zyu@yugabyte.com

Hi,
In sqlsh, I issued `\timing on`.

I don't see timing information displayed for `\c database`.

Does someone know how I can obtain such information ?

Thanks

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: Zhihong Yu (#1)
Re: timing information for switching database

Hi

ne 21. 8. 2022 v 14:41 odesílatel Zhihong Yu <zyu@yugabyte.com> napsal:

Hi,
In sqlsh, I issued `\timing on`.

I don't see timing information displayed for `\c database`.

Does someone know how I can obtain such information ?

you cannot do it in psql

you can write custom application and you can measure disconnect - connect
time

Regards

Pavel

Show quoted text

Thanks

#3Junwang Zhao
zhjwpku@gmail.com
In reply to: Zhihong Yu (#1)
Re: timing information for switching database

*\timing* set the pset.timing flag of the global psql options, and use it
in the client side to indicate whether to print the query time or not.

There are two places using it, *SendQuery* and *PSQLexecWatch*,
you may check these functions and add the *timing* logic in
function *exec_command_connect* to display the time infomation,
but this should be only used for your own testing purpose.

On Sun, Aug 21, 2022 at 8:41 PM Zhihong Yu <zyu@yugabyte.com> wrote:

Hi,
In sqlsh, I issued `\timing on`.

I don't see timing information displayed for `\c database`.

Does someone know how I can obtain such information ?

Thanks

--
Regards
Junwang Zhao