Re: [PATCH] Add extra statistics to explain for Nested Loop

From: e(dot)sokolova(at)postgrespro(dot)ru
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Add extra statistics to explain for Nested Loop
Date: 2021-04-14 11:27:36
Message-ID: be95dbd55eae0974c89b56bc302bcb3a@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you for working on this issue. Your comments helped me make this
patch more correct.

> Lines with "colon" format shouldn't use equal signs, and should use two
> spaces
> between fields.
Done. Now extra line looks like "Loop min_rows: %.0f max_rows: %.0f
total_rows: %.0f" or "Loop min_time: %.3f max_time: %.3f min_rows:
%.0f max_rows: %.0f total_rows: %.0f".

> Since this is now on a separate line, the "if (nloops > 1 &&
> es->verbose)"
> can be after the existing "if (es->timing)", and shouldn't need its own
> "if (es->timing)". It should conditionally add a separate line, rather
> than
> duplicating the "(actual.*" line.
>
>> - if (es->timing)
>> + if (nloops > 1 && es->verbose)
New version of patch contains this correction. It helped make the patch
shorter.

> In non-text mode, think you should not check "nloops > 1". Rather,
> print the
> field as 0.
The fields will not be zeros. New line will almost repeat the line with
main sttistics.

> I think the labels in non-text format should say "Loop Min Time" or
> similar.
>
> And these variables should have a loop_ prefix like loop_min_t ?
There are good ideas. I changed it.

I apply new version of this patch. I hope it got better.
Please don't hesitate to share any thoughts on this topic.

--
Ekaterina Sokolova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
extra_statistics_v4.patch text/x-diff 14.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-04-14 11:51:12 Re: Monitoring stats docs inconsistency
Previous Message Joel Jacobson 2021-04-14 10:53:49 Re: jsonb subscripting assignment performance