Re: estimates for nested loop very wrong?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: estimates for nested loop very wrong?
Дата
Msg-id 4867.1049993075@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: estimates for nested loop very wrong?  (joostje@komputilo.org)
Ответы Re: estimates for nested loop very wrong?  (joostje@komputilo.org)
Список pgsql-sql
joostje@komputilo.org writes:
> Unless I'm mistaken, pg_nstats.n_distinct should be (aproximately) the same as
> count(distinct(id)), but it obviously isn't. Also the most_common_freqs
> values are about a 100 times higher than in reality, and, even tough about
> 900 values of id occur more often than 40 times, in the 'most_common_vals'
> list are 7 (of the 10) vals that occur less than 40 times, and the real
> top two isn't even represented.

Please try increasing the statistics target (see ALTER TABLE) for db.id, then
re-analyze and see if the estimates get better.  The default setting is
10 --- try 20, 50, 100 to see what happens.
        regards, tom lane



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

Предыдущее
От: joostje@komputilo.org
Дата:
Сообщение: Re: estimates for nested loop very wrong?
Следующее
От: Ian Barwick
Дата:
Сообщение: Re: INSERT INTO ... SELECT (PostgreSQL vs. MySQL)