Re: Seeking help with a query that takes too long

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Seeking help with a query that takes too long
Дата
Msg-id 9083.1068653434@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Seeking help with a query that takes too long  ("Nick Fankhauser" <nickf@ontko.com>)
Ответы Re: Seeking help with a query that takes too long  ("Nick Fankhauser" <nickf@ontko.com>)
Список pgsql-performance
"Nick Fankhauser" <nickf@ontko.com> writes:
>> Nick, can you find out why this row count estimation is so far off?

> It's actually correct:

Sure, the 3501 was the "actual".  The estimate was 1 row, which was
pretty far off :-(

> Here are the stats:

It looks like you are running with the default statistics target (10).
Try boosting it to 100 or even more for this column (see ALTER TABLE
SET STATISTICS, then re-ANALYZE) and see if the estimate gets better.
I think the major problem is likely here:
> n_distinct        | 24215
which is no doubt much too small (do you have an idea of the number
of distinct actor_full_name_uppercase values?)

            regards, tom lane

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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: Value of Quad vs. Dual Processor machine
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: *very* slow query to summarize data for a month ...