Re: proposal : cross-column stats - Mailing list pgsql-hackers

From Florian Pflug
Subject Re: proposal : cross-column stats
Date
Msg-id C6F0DEEC-3CF2-4194-9582-304874760ABA@phlo.org
Whole thread Raw
In response to Re: proposal : cross-column stats  (Tomas Vondra <tv@fuzzy.cz>)
Responses Re: proposal : cross-column stats  (tv@fuzzy.cz)
List pgsql-hackers
On Dec17, 2010, at 23:12 , Tomas Vondra wrote:
> Well, not really - I haven't done any experiments with it. For two
> columns selectivity equation is
> 
>      (dist(A) * sel(A) + dist(B) * sel(B)) / (2 * dist(A,B))
> 
> where A and B are columns, dist(X) is number of distinct values in
> column X and sel(X) is selectivity of column X.

Huh? This is the selectivity estimate for "A = x AND B = y"? Surely,
if A and B are independent, the formula must reduce to sel(A) * sel(B),
and I cannot see how that'd work with the formula above.

best regards,
Florian Pflug



pgsql-hackers by date:

Previous
From: David Christensen
Date:
Subject: Re: plperlu problem with utf8
Next
From: Alex Hunsaker
Date:
Subject: Re: plperlu problem with utf8