\timing interval

Поиск
Список
Период
Сортировка
От Corey Huinker
Тема \timing interval
Дата
Msg-id CADkLM=dbC4R8sbbuFXQVBFWoJGQkTEW8RWnC0PbW9nZsovZpJQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: \timing interval  (Peter Geoghegan <pg@heroku.com>)
Re: \timing interval  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
\timing is great.
\timing is helpful.
\timing has made me really good at mentally estimating numbers modulo 3600000.

Wouldn't it be great if we had a way of printing timing in more human friendly formats?

Attached is a patch that allows the following (new/interesting bits in bold):

# \timing off
Timing is off.
# select pg_sleep(1);
 pg_sleep
----------

(1 row)

# \timing
Timing is on.
# select pg_sleep(1);
 pg_sleep
----------

(1 row)

Time: 1002.959 ms
# \timing interval
Timing is interval.
# select pg_sleep(1);
 pg_sleep
----------

(1 row)

Time: 00:00:01.003
# \timing
Timing is off.


As demonstrated, "interval" toggles to "off". There is no way to toggle to "interval".

I'm pretty flexible on how something like this gets invoked. We could leave timing alone and create a format variable. We could actually leverage the pre-existing interval-to-string code, etc.

Note: the current patch includes no doc changes. I'd figure I'd wait to do that after this patch or another gains some traction.
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: SELECT DISTINCT never uses an index?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [PATCH] add option to pg_dumpall to exclude tables from the dump