Re: Showing applied extended statistics in explain - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Showing applied extended statistics in explain
Date
Msg-id 459863.1627419001@sss.pgh.pa.us
Whole thread Raw
In response to Re: Showing applied extended statistics in explain  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: Showing applied extended statistics in explain  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Re: Showing applied extended statistics in explain  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Tomas Vondra <tomas.vondra@enterprisedb.com> writes:
> On 7/27/21 12:21 PM, Dmitry Dolgov wrote:
>>> So it seems useful to include this into in the explain plan - show which
>>> statistics were applied, in which order. Attached is an early PoC patch
>>> doing that in VERBOSE mode. I'll add it to the next CF.

> Yes. I think providing more insight into which statistics were applied,
> in which order and to which clauses, is quite desirable.

TBH I do not agree that this is a great idea.  I think it's inevitably
exposing a lot of unstable internal planner details.  I like even less
the aspect that this means a lot of information has to be added to the
finished plan in case it's needed for EXPLAIN.  Aside from the sheer
cost of copying that data around, what happens if for example somebody
drops a statistic object between the time of planning and the EXPLAIN?
Are we going to start keeping locks on those objects for the lifetime
of the plans?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Showing applied extended statistics in explain
Next
From: Robert Haas
Date:
Subject: Re: [Patch] ALTER SYSTEM READ ONLY