Re: explain plans with information about (modified) gucs
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Rafia Sabih <rafia.pghackers@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, John Naylor <john.naylor@2ndquadrant.com>, Sergei Agalakov <sergei.agalakov@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-03-26T20:04:53Z
Lists: pgsql-hackers
Attachments
- explain-with-settings-20190326.patch (text/plain) patch
On Mon, Mar 18, 2019 at 11:31:48AM +0100, Rafia Sabih wrote:
>On Sun, 24 Feb 2019 at 00:06, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
>>
>> Hi,
>>
>> attached is an updated patch, fixing and slightly tweaking the docs.
>>
>>
>> Barring objections, I'll get this committed later next week.
>>
>I was having a look at this patch, and this kept me wondering,
>
>+static void
>+ExplainShowSettings(ExplainState *es)
>+{
>Is there some reason for not providing any explanation above this
>function just like the rest of the functions in this file?
>
>Similarly, for
>
>struct config_generic **
>get_explain_guc_options(int *num)
>{
>
>/* also bail out of there are no options */
>+ if (!num)
>+ return;
>I think you meant 'if' instead if 'of' here.
Thanks for the review - attached is a patch adding the missing comments,
and doing two additional minor improvements:
1) Renaming ExplainShowSettings to ExplainPrintSettings, to make it more
consistent with naming of the other functions in explain.c.
2) Actually counting GUC_EXPLAIN options, and only allocating space for
those in get_explain_guc_options, instead of using num_guc_variables. The
diffrence is quite significant (~50 vs. ~300), and considering each entry
is 8B it makes a difference because such large chunks tend to have higher
palloc overhed (due to ALLOCSET_SEPARATE_THRESHOLD).
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Add SETTINGS option to EXPLAIN, to print modified settings.
- ea569d64ac71 12.0 landed
-
Switch some palloc/memset calls to palloc0
- 1983af8e8993 12.0 cited