Re: Improving N-Distinct estimation by ANALYZE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improving N-Distinct estimation by ANALYZE
Date
Msg-id 17038.1137213458@sss.pgh.pa.us
Whole thread Raw
In response to Re: Improving N-Distinct estimation by ANALYZE  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Improving N-Distinct estimation by ANALYZE
List 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


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Improving N-Distinct estimation by ANALYZE
Next
From: Jaime Casanova
Date:
Subject: message for constraint