Re: Improving N-Distinct estimation by ANALYZE
От | Jim C. Nasby |
---|---|
Тема | Re: Improving N-Distinct estimation by ANALYZE |
Дата | |
Msg-id | 20060116182643.GE67693@pervasive.com обсуждение исходный текст |
Ответ на | Re: Improving N-Distinct estimation by ANALYZE (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Improving N-Distinct estimation by ANALYZE
|
Список | 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 по дате отправления: