Re: Cross-column statistics revisited - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: Cross-column statistics revisited
Date
Msg-id 20081016171126.GB19967@svana.org
Whole thread Raw
In response to Cross-column statistics revisited  ("Joshua Tolley" <eggyknap@gmail.com>)
Responses Re: Cross-column statistics revisited
Re: Cross-column statistics revisited
List pgsql-hackers
On Wed, Oct 15, 2008 at 04:53:10AM -0600, Joshua Tolley wrote:
> I've been interested in what it would take to start tracking
> cross-column statistics. A review of the mailing lists as linked from
> the TODO item on the subject [1] suggests the following concerns:
>
> 1) What information exactly would be tracked?
> 2) How would it be kept from exploding in size?
> 3) For which combinations of columns would statistics be kept?

I think you need to go a step back: how are you going to use this data?
Whatever structure you choose the eventual goal you take a discription
of the column (a,b) and take a clause like 'a < 5' and be able to
generate an estimate of the distribution of b.

Secondly, people arn't going to ask for multi-column stats on column
that arn't correlated in some way. So you need to work out what kinds
of correlation people are interested in and see how you can store them.

One potential use case is the (startdate,enddate) columns. Here what
you want to detect somehow that the distribution of (enddate-startdate)
is constant.

I think the real question is: what other kinds of correlation might
people be interested in representing?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Deriving Recovery Snapshots
Next
From: Tom Lane
Date:
Subject: Re: Cross-column statistics revisited