Re: WIP: cross column correlation ...

Martijn van Oosterhout <kleptog@svana.org>

From: Martijn van Oosterhout <kleptog@svana.org>
To: Greg Stark <gsstark@mit.edu>
Cc: PostgreSQL - Hans-Jürgen Schönig <postgres@cybertec.at>, Robert Haas <robertmhaas@gmail.com>, Grzegorz Jaskiewicz <gj@pointblue.com.pl>, Bruce Momjian <bruce@momjian.us>, Josh Berkus <josh@agliodbs.com>, pgsql-hackers Hackers <pgsql-hackers@postgresql.org>, Boszormenyi Zoltan <zb@cybertec.at>
Date: 2011-02-26T18:58:20Z
Lists: pgsql-hackers
On Sat, Feb 26, 2011 at 06:44:52PM +0000, Greg Stark wrote:
> 2011/2/26 PostgreSQL - Hans-Jürgen Schönig <postgres@cybertec.at>:
> > what we are trying to do is to explicitly store column correlations. so, a histogram for (a, b) correlation and so on.
> 
> The problem is that we haven't figured out how to usefully store a
> histogram for <a,b>. Consider the oft-quoted example of a
> <city,postal-code>  -- or <city,zip code> for Americans. A histogram
> of the tuple is just the same as a histogram on the city. 

But there are cases where it can work. Frankly the example you mention
is odd because for we can't even build useful 1D histograms for <city>
and <zip code>, so the fact that 2D is hard is not surprising.

The histograms we do build work fine from > and <, just equality. The
2D will handle the same.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patriotism is when love of your own people comes first; nationalism,
> when hate for people other than your own comes first. 
>                                       - Charles de Gaulle