A method for consistent selectivity estimation based on the principle of
maximum entropy (ME) is provided. The method efficiently exploits all
available information and avoids the bias problem. In the absence of
detailed knowledge, the ME approach reduces to standard uniformity and
independence assumptions. The disclosed method, based on the principle of
ME, is used to improve the optimizer's cardinality estimates by orders of
magnitude, resulting in better plan quality and significantly reduced
query execution times.