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

From Andrei Lepikhov
Subject Re: Showing applied extended statistics in explain Part 2
Date
Msg-id d480e486-4f90-45a6-8bf9-faf5db7e4899@gmail.com
Whole thread Raw
In response to Showing applied extended statistics in explain Part 2  (Tatsuro Yamada <tatsuro.yamada@ntt.com>)
List pgsql-hackers
On 11/1/24 12:22, Tatsuro Yamada wrote:
> Hi All,
> 
> I apologize for not being able to continue development due to various 
> circumstances.
> The attached file is the rebased patch.
> I will now catch up on the discussion and try to revise the patch.
I wonder why it’s so important to know exactly where and who has used 
extended statistics.

I often use SQL Server to compare execution plans generated by 
PostgreSQL, and I appreciate how they display the usage of extended 
statistics. They clearly identify which statistics were utilized during 
query planning and include them in the summary section of query plan.

I find this method much easier to implement, as it allows us to see any 
usage points - remember that `estimate_num_groups` may be applied in 
multiple places and may not always correspond to a node clause.

It’s worth noting that some clauses may be transformed during the 
planning process, and the scan filter may not align with the estimated 
clause. It’s possible that certain clauses might not appear in the final 
estimated plan based on the extended statistics.

If necessary, we could add an `extstat_ID` to the summary to reference 
it in the plan nodes.

-- 
regards, Andrei Lepikhov



pgsql-hackers by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: [PATCH] Optionally record Plan IDs to track plan changes for a query
Next
From: Benoit Lobréau
Date:
Subject: Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)