Re: Improving N-Distinct estimation by ANALYZE

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: josh@agliodbs.com
Cc: Simon Riggs <simon@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2006-01-14T04:37:38Z
Lists: pgsql-hackers
Josh Berkus <josh@agliodbs.com> writes:
>> It's also worth mentioning that for datatypes that only have an "="
>> operator the performance of compute_minimal_stats is O(N^2) when values
>> are unique, so increasing sample size is a very bad idea in that case.

> Hmmm ... does ANALYZE check for UNIQUE constraints?

Our only implementation of UNIQUE constraints is btree indexes, which
require more than an "=" operator, so this seems irrelevant.

			regards, tom lane