Re: multivariate statistics / patch v7
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Jeff Janes <jeff.janes@gmail.com>, Stephen Frost <sfrost@snowman.net>,
Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Date: 2015-05-25T20:43:46Z
Lists: pgsql-hackers
Attachments
- 0001-teach-expression-walker-about-RestrictInfo-v7.patch (text/x-patch) patch v7-0001
- 0002-shared-infrastructure-and-functional-dependencies-v7.patch (text/x-patch)
- 0003-clause-reduction-using-functional-dependencies-v7.patch (text/x-patch) patch v7-0003
- 0004-multivariate-MCV-lists-v7.patch (text/x-patch) patch v7-0004
- 0005-multivariate-histograms-v7.patch (text/x-patch) patch v7-0005
- 0006-multi-statistics-estimation-v7.patch (text/x-patch) patch v7-0006
Hello, attached is v7 of the multivariate stats patch. The main improvement is major refactoring of the clausesel.c portion - splitting the awfully long spaghetti-style functions into smaller pieces, making it much more understandable etc. I do assume some of those pieces are unnecessary because there already is a helper function with the same purpose (but I'm not aware of that). But IMHO this piece of code begins to look reasonable (especially when compared to the previous state). The other major improvement it review of the comments (including FIXMEs and TODOs), and removal of the obsolete / misplaced ones. And there was plenty of those ... These changes made this version ~20k smaller than v6. The patch also rebases to current master, which I assume shall be quite stable - so hopefully no more duplicate OIDs for a while. There are 6 files attached, but only 0002-0006 are actually part of the multivariate statistics patch itself. The first part makes it possible to use pull_varnos() with expression trees containing RestrictInfo nodes, but maybe this is not the right way to fix this (there's another thread where this was discussed). Also, the regression tests testing plan choice with multivariate stats (e.g. that a bitmap index scan is chosen instead of index scan) fail from time to time. I suppose this happens because the invalidation after ANALYZE is not processed before executing the query, so the optimizer does not see the stats, or something like that. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Collect and use multi-column dependency stats
- 2686ee1b7ccf 10.0 landed
-
Implement SortSupport for macaddr data type
- f90d23d0c518 10.0 cited
-
Implement multivariate n-distinct coefficients
- 7b504eb282ca 10.0 landed
-
Generate fmgr prototypes automatically
- 352a24a1f9d6 10.0 cited