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>
Re: ExplainProperty* and units Andres Freund <andres@anarazel.de>
Re: ExplainProperty* and units Tom Lane <tgl@sss.pgh.pa.us>
Re: ExplainProperty* and units Andres Freund <andres@anarazel.de>
Re: ExplainProperty* and units Tom Lane <tgl@sss.pgh.pa.us>
Re: ExplainProperty* and units Andres Freund <andres@anarazel.de>
Re: ExplainProperty* and units Andres Freund <andres@anarazel.de>
Re: ExplainProperty* and units David Rowley <david.rowley@2ndquadrant.com>
Re: ExplainProperty* and units Andres Freund <andres@anarazel.de>
Re: ExplainProperty* and units David Rowley <david.rowley@2ndquadrant.com>
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
Дата:
От: David Steele
Дата:
FAQ