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

From Jim C. Nasby
Subject Re: Improving N-Distinct estimation by ANALYZE
Date
Msg-id 20060116182643.GE67693@pervasive.com
Whole thread Raw
In response to Re: Improving N-Distinct estimation by ANALYZE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Improving N-Distinct estimation by ANALYZE
List pgsql-hackers
On Fri, Jan 13, 2006 at 11:37:38PM -0500, Tom Lane wrote:
> 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.

IIRC, the point was that if we know a field has to be unique, there's no
sense in doing that part of the analysis on it; you'd only care about
correlation.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Warm-up cache may have its virtue
Next
From: Neil Conway
Date:
Subject: Re: source documentation tool doxygen