Re: Query performance PLEASE HELP

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query performance PLEASE HELP
Дата
Msg-id 24304.1044043986@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query performance PLEASE HELP  (Dmitry Tkach <dmitry@openratings.com>)
Список pgsql-general
Dmitry Tkach <dmitry@openratings.com> writes:
> What does NEGATIVE n_distinct mean (for managed_supplier.duns)? :-)

Fractional estimate --- in particular, -1 means it thinks the column
is unique.  tradestyle.duns is not really unique by itself, is it?

> It lies about many things... For example - n_distinct for
> tradestyle.name = 385825 is about 100 times small than the actual number
> (which is a little over 30 million)

It might help to raise the statistics target for these columns and
re-ANALYZE.  Try 100 or so instead of the default 10.

However, even with these stats I'd think it would pick up on the
tradestyle.name index as a likely thing to use.  What was the
database's locale setting, again?

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: "Andy Kriger"
Дата:
Сообщение: empty contrib diurectories?
Следующее
От: Simon Mitchell
Дата:
Сообщение: Re: Basic SQL join question