ExplainProperty* and units
От
Andres Freund
Тема
ExplainProperty* and units
Дата
Msg-id
20180314002740.cah3mdsonz5mxney@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,
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).
The most valid counterargument I see is that in many cases, particularly
inside plans, we have more specific output for text mode anyway. Which
means there we'll not benefit much. But I think that's a) considerably
done due to backward compatibility concerns b) verbosity concerns inside
plans, which obviously can be complicated. Therefore I think it's
perfectly reasonable to avoid specific branches for data that's only
going to be displayed once per plan?
We also could add separate ExplainProperty*Unit(...) functions, but I
don't really see a need.
Comments?
Greetings,
Andres Freund
В списке pgsql-hackers по дате отправления