\timing interval
| От | Corey Huinker |
|---|---|
| Тема | \timing interval |
| Дата | |
| Msg-id | CADkLM=dbC4R8sbbuFXQVBFWoJGQkTEW8RWnC0PbW9nZsovZpJQ@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: \timing interval
Re: \timing interval |
| Список | pgsql-hackers |
\timing is great.
\timing is helpful.
\timing has made me really good at mentally estimating numbers modulo 3600000.
\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 offTiming is off.# select pg_sleep(1);pg_sleep----------(1 row)# \timingTiming is on.# select pg_sleep(1);pg_sleep----------(1 row)Time: 1002.959 ms# \timing intervalTiming is interval.# select pg_sleep(1);pg_sleep----------(1 row)Time: 00:00:01.003# \timingTiming 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 по дате отправления: