v10 release notes for extended stats - Mailing list pgsql-hackers

From Justin Pryzby
Subject v10 release notes for extended stats
Date
Msg-id 20201219193927.GD30237@telsasoft.com
Whole thread Raw
Responses Re: v10 release notes for extended stats
List pgsql-hackers
2017-03-24 [7b504eb28] Implement multivariate n-distinct coefficients
2017-04-05 [2686ee1b7] Collect and use multi-column dependency stats
2017-05-12 [bc085205c] Change CREATE STATISTICS syntax

The existing notes say:
|Add multi-column optimizer statistics to compute the correlation ratio and number of distinct values (Tomas Vondra,
DavidRowley, Álvaro Herrera)
 
|New commands are CREATE STATISTICS, ALTER STATISTICS, and DROP STATISTICS.
|This feature is helpful in estimating query memory usage and when combining the statistics from individual columns.

"correlation ratio" is referring to stxkind=d (dependencies), right ?  That's
very unclear.

"helpful in estimating query memory usage": I guess it means that this allows
the planner to correctly account for large vs small number of GROUP BY values,
but it sounds more like it's going to help a user to estimate memory use.

"when combining the statistics from individual columns." this is referring to
stxkind=d, handling correlated/redundant clauses, but it'd be hard for a user
to know that.

Also, maybe it should say "combining stats from columns OF THE SAME TABLE".

So I propose:
|Allow creation of multi-column statistics objects, for computing the
|dependencies between columns and number of distinct values of combinations of columns
|(Tomas Vondra, |David Rowley, Álvaro Herrera)
|The new commands are CREATE STATISTICS, ALTER STATISTICS, and DROP STATISTICS.
|Improved statistics allow the planner to generate better query plans with more accurate
|estimates of the row count and memory usage when grouping by multiple
|columns, and more accurate estimates of the row count if WHERE clauses apply
|to multiple columns and values of some columns are correlated with values of
|other columns.



pgsql-hackers by date:

Previous
From: Першин Юрий Петрович
Date:
Subject: RE: libpq @windows : leaked singlethread_lock makes AppVerifier unhappy
Next
From: Bruce Momjian
Date:
Subject: Re: v10 release notes for extended stats