Re: multivariate statistics (v19)
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Ants Aasma <ants.aasma@eesti.ee>
Cc: Tatsuo Ishii <ishii@postgresql.org>, Robert Haas <robertmhaas@gmail.com>,
david@pgmasters.net, Tom Lane <tgl@sss.pgh.pa.us>,
Alvaro Herrera <alvherre@2ndquadrant.com>, petr@2ndquadrant.com,
Jeff Janes <jeff.janes@gmail.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2016-08-10T18:07:23Z
Lists: pgsql-hackers
On 08/10/2016 03:29 PM, Ants Aasma wrote: > On Wed, Aug 3, 2016 at 4:58 AM, Tomas Vondra > <tomas.vondra@2ndquadrant.com> wrote: >> 2) combining multiple statistics >> >> I think the ability to combine multivariate statistics (covering different >> subsets of conditions) is important and useful, but I'm starting to think >> that the current implementation may not be the correct one (which is why I >> haven't written the SGML docs about this part of the patch series yet). > > While researching this topic a few years ago I came across a paper on > this exact topic called "Consistently Estimating the Selectivity of > Conjuncts of Predicates" [1]. While effective it seems to be quite > heavy-weight, so would probably need support for tiered optimization. > > [1] https://courses.cs.washington.edu/courses/cse544/11wi/papers/markl-vldb-2005.pdf > I think I've read that paper some time ago, and IIRC it's solving the same problem but in a very different way - instead of combining the statistics directly, it relies on the "partial" selectivities and then estimates the total selectivity using the maximum-entropy principle. I think it's a nice idea and it probably works fine in many cases, but it kinda throws away part of the information (that we could get by matching the statistics against each other directly). But I'll keep that paper in mind, and we can revisit this solution later. 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