Re: ExplainProperty* and units

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: ExplainProperty* and units
Дата
Msg-id 20180314175853.a5h35zfcetmdwlk4@alap3.anarazel.de
обсуждение исходный текст
Ответ на ExplainProperty* and units  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

On 2018-03-13 17:27:40 -0700, Andres Freund wrote:
> while adding EXPLAIN support for JITing (displaying time spent etc), I
> got annoyed by the amount of duplication required. There's a fair amount
> of
>     if (es->format == EXPLAIN_FORMAT_TEXT)
>         appendStringInfo(es->str, "Execution time: %.3f ms\n",
>                                          1000.0 * totaltime);
>     else
>         ExplainPropertyFloat("Execution Time", 1000.0 * totaltime,
> which is fairly redundant.
> 
> In the attached *POC* patch I've added a 'unit' parameter to the numeric
> ExplainProperty* functions, which EXPLAIN_FORMAT_TEXT adds to the
> output.  This can avoid the above and other similar branches (of which
> the JIT patch would add a number).

Here's a series of two, a bit more carefully done, patches.  First
removes ExplainPropertyLong, expands ExplainPropertyInteger to
64bits. Second adds the unit argument.

Whether we want to go for the first one, or revise first patch to just
rename ExplainPropertyInt64 remains to be discussed.  I still slightly
prefer the approach presented here.

- Andres

Вложения

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: User defined data types in Logical Replication
Следующее
От: David Steele
Дата:
Сообщение: Re: PATCH: Configurable file mode mask