Re: Additional improvements to extended statistics
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-03-14T16:56:10Z
Lists: pgsql-hackers
Attachments
On Fri, Mar 13, 2020 at 04:54:51PM +0000, Dean Rasheed wrote: >On Mon, 9 Mar 2020 at 00:06, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote: >> >> On Mon, Mar 09, 2020 at 01:01:57AM +0100, Tomas Vondra wrote: >> > >> >Attaches is an updated patch series >> >with parts 0002 and 0003 adding tests demonstrating the issue and then >> >fixing it (both shall be merged to 0001). >> > >> >> One day I won't forget to actually attach the files ... >> > >0001-0003 look reasonable to me. > >One minor point -- there are now 2 code blocks that are basically the >same, looping over a list of clauses, calling clause_selectivity() and >then applying the "s1 = s1 + s2 - s1 * s2" formula. Perhaps they could >be combined into a new function (clauselist_selectivity_simple_or(), >say). I guess it would need to be passed the initial starting >selectivity s1, but it ought to help reduce code duplication. > Attached is a patch series rebased on top of the current master, after committing the ScalarArrayOpExpr enhancements. I've updated the OR patch to get rid of the code duplication, and barring objections I'll get it committed shortly together with the two parts improving test coverage. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Improve estimation of ANDs under ORs using extended statistics.
- 4f5760d4afa9 14.0 landed
-
Improve estimation of OR clauses using multiple extended statistics.
- 88b0898fe35a 14.0 landed
-
Improve estimation of OR clauses using extended statistics.
- 25a9e54d2db3 14.0 landed
-
Prevent functional dependency estimates from exceeding column estimates.
- 87779aa47463 13.0 landed
-
Fix wording of several extended stats comments
- 6f72dbc48bf8 13.0 landed
-
Improve test coverage for multi-column MCV lists
- d8cfa82d51f8 13.0 landed
-
Improve test coverage for functional dependencies
- f9696782c701 13.0 landed