Re: estimating # of distinct values

Поиск
Список
Период
Сортировка
Искать
От
Heikki Linnakangas
Тема
Re: estimating # of distinct values
Дата
Msg-id
4D37EDEE.9070906@enterprisedb.com
Ответ на
Список
Дерево обсуждения
estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Josh Berkus <josh@agliodbs.com>
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values tv@fuzzy.cz
Re: estimating # of distinct values "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: estimating # of distinct values tv@fuzzy.cz
Re: estimating # of distinct values Josh Berkus <josh@agliodbs.com>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: estimating # of distinct values Tom Lane <tgl@sss.pgh.pa.us>
Re: estimating # of distinct values "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Florian Pflug <fgp@phlo.org>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Alvaro Herrera <alvherre@commandprompt.com>
Re: estimating # of distinct values Tom Lane <tgl@sss.pgh.pa.us>
Re: estimating # of distinct values Alvaro Herrera <alvherre@commandprompt.com>
Re: estimating # of distinct values Jim Nasby <jim@nasby.net>
Re: estimating # of distinct values Csaba Nagy <ncslists@googlemail.com>
Re: estimating # of distinct values tv@fuzzy.cz
Re: estimating # of distinct values Csaba Nagy <ncslists@googlemail.com>
Re: estimating # of distinct values tv@fuzzy.cz
Re: estimating # of distinct values Jim Nasby <jim@nasby.net>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Jim Nasby <jim@nasby.net>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Jim Nasby <jim@nasby.net>
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values Jim Nasby <jim@nasby.net>
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values Tom Lane <tgl@sss.pgh.pa.us>
Re: estimating # of distinct values Jim Nasby <jim@nasby.net>
Re: estimating # of distinct values Jim Nasby <jim@nasby.net>
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values tv@fuzzy.cz
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values Tom Lane <tgl@sss.pgh.pa.us>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Csaba Nagy <ncslists@googlemail.com>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Nathan Boley <npboley@gmail.com>
Re: estimating # of distinct values Florian Pflug <fgp@phlo.org>
Re: estimating # of distinct values Nathan Boley <npboley@gmail.com>
Re: estimating # of distinct values Florian Pflug <fgp@phlo.org>
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values Nathan Boley <npboley@gmail.com>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Nathan Boley <npboley@gmail.com>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Robert Haas <robertmhaas@gmail.com>
Re: estimating # of distinct values Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
Re: estimating # of distinct values Tomas Vondra <tv@fuzzy.cz>
On 20.01.2011 04:36, Robert Haas wrote:
> ... Even better, the
> code changes would be confined to ANALYZE rather than spread out all
> over the system, which has positive implications for robustness and
> likelihood of commit.

Keep in mind that the administrator can already override the ndistinct 
estimate with ALTER TABLE. If he needs to manually run a special ANALYZE 
command to make it scan the whole table, he might as well just use ALTER 
TABLE to tell the system what the real (or good enough) value is. A DBA 
should have a pretty good feeling of what the distribution of his data 
is like.

And how good does the estimate need to be? For a single-column, it's 
usually not that critical, because if the column has only a few distinct 
values then we'll already estimate that pretty well, and OTOH if 
ndistinct is large, it doesn't usually affect the plans much if it's 10% 
of the number of rows or 90%.

It seems that the suggested multi-column selectivity estimator would be 
more sensitive to ndistinct of the individual columns. Is that correct? 
How is it biased? If we routinely under-estimate ndistinct of individual 
columns, for example, does the bias accumulate or cancel itself in the 
multi-column estimate?

I'd like to see some testing of the suggested selectivity estimator with 
the ndistinct estimates we have. Who knows, maybe it works fine in practice.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com

В списке pgsql-hackers по дате отправления
От: Pavel Stehule
Дата:
От: Dimitri Fontaine
Дата:
FAQ