On 23/02/2023 13:20, Peter Eisentraut wrote:
> On 22.02.23 19:14, Heikki Linnakangas wrote:
>> How about a new backslash command or psql variable to show how long the
>> previous statement took? Something like:
>
> If you don't have \timing turned on before the query starts, psql won't
> record what the time was before the query, so you can't compute the run
> time afterwards. This kind of feature would only work if you always
> take the start time, even if \timing is turned off.
Correct. That seems acceptable though? gettimeofday() can be slow on
some platforms, but I doubt it's *that* slow, that we couldn't call it
two times per query.
- Heikki