Hi, I found below formula to compute selectivities, but I think the last Probability 'P(b=?)' should be 'P(c=?)'.
P(a=?,b=?,c=?) = P(a=?,b=?) * (d + (1-d)*P(b=?))
Attached patch fixes it, and it also adds some spaces following another formula which is on line 86 and computes P(a=?, b=?). Regards, -- Atsushi Torikoshi NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
diff --git a/src/backend/statistics/README.dependencies b/src/backend/statistics/README.dependencies index 59f9d57..d10e4d0 100644 --- a/src/backend/statistics/README.dependencies +++ b/src/backend/statistics/README.dependencies @@ -90,7 +90,7 @@ Where 'd' is the degree of functional dependence (a=>b). With more than two equality clauses, this process happens recursively. For example for (a,b,c) we first use (a,b=>c) to break the computation into - P(a=?,b=?,c=?) = P(a=?,b=?) * (d + (1-d)*P(b=?)) + P(a=?,b=?,c=?) = P(a=?,b=?) * (d + (1-d) * P(c=?)) and then apply (a=>b) the same way on P(a=?,b=?).
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers