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

From: e(dot)sokolova(at)postgrespro(dot)ru
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, rjuju123(at)gmail(dot)com
Subject: Re: [PATCH] Add extra statistics to explain for Nested Loop
Date: 2020-11-12 20:10:05
Message-ID: 35976aa41e4ca6f7782d336e7758636e@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tomas Vondra писал 2020-10-31 04:20:

> seems like an interesting and useful improvement. I did a quick review
> of the patch - attached is a 0002 patch with a couple minor changes
> (the
> 0001 is just your v1 patch, to keep cfbot happy).

Thank you for your review and changes!

> 3) In ExplainNode, in the part processing per-worker stats, I think
> some
> of the fields are incorrectly referencing planstate->instrument instead
> of using the 'instrument' variable from WorkerInstrumentation.

It's correct behavior because of struct WorkerInstrumentation contains
struct Instrumentation instrument. But planstate->instrument is struct
Instrumentation too.

> I wonder if we should have another option EXPLAIN option enabling this.
> I.e. by default we'd not collect/print this, and users would have to
> pass some option to EXPLAIN. Or maybe we could tie this to VERBOSE?

It's good idea. Now additional statistics are only printed when we set
the VERBOSE.

New version of this patch prints extra statistics for all cases of
multiple loops, not only for Nested Loop. Also I fixed the example by
adding VERBOSE.

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_v2.patch text/x-diff 12.3 KB
example_v1.sql text/plain 402.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Eugen Konkov 2020-11-12 20:13:08 Re: Proposition for autoname columns
Previous Message Bruce Momjian 2020-11-12 20:01:10 Re: Add important info about ANALYZE after create Functional Index