Re: An Analyze question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: An Analyze question
Дата
Msg-id 17407.1019497221@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: An Analyze question  ("Nick Fankhauser" <nickf@ontko.com>)
Ответы Re: An Analyze question  ("Nick Fankhauser" <nickf@ontko.com>)
Список pgsql-admin
"Nick Fankhauser" <nickf@ontko.com> writes:
> The "Before" database:

>          attname          | attdispersion | starelid | staattnum | staop |
> stanullfrac | stacommonfrac | stacommonval  |          staloval           |
> stahival
> --------------------------+---------------+----------+-----------+-------+--
> -----------+---------------+---------------+-----------------------------+--
> ---------------------
>  actor_id                 |    0.00761992 |  2591915 |         1 |  1066 |
> 0 |     0.0335872 | JTW           | 18105A08315 49              | XS

> The "After" database:

>          attname          | attdispersion | starelid | staattnum | staop |
> stanullfrac | stacommonfrac |    stacommonval    |          staloval
> |       stahival
> --------------------------+---------------+----------+-----------+-------+--
> -----------+---------------+--------------------+---------------------------
> -+-----------------------
>  actor_id                 |       0.03247 | 33979335 |         1 |  1066 |
> 0 |      0.112092 | 18105XS            | 18105A                     |
> 18105XS

Hm.  In the "before" case you are showing JTW as the most common
actor_id, with a frequency of 3.36% of the entries (busy judge,
I suppose).

In the "after" case you are showing "18105XS" as the most common
actor_id, with a frequency of 11.2% of the entries.  Where'd that
come from?  Is it correct?

The change in plans occurs because of the increase in stacommonfrac.
7.1 basically uses stacommonfrac as the selectivity estimate if the
constant is the stacommonval, otherwise stacommonfrac/10.  So if
stacommonfrac goes up, so does the estimated number of rows retrieved,
and that's what's changing your plan.

            regards, tom lane

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

Предыдущее
От: Denny-Schierz
Дата:
Сообщение: Linux user www-data has no access to amphora2 DB
Следующее
От: Denny-Schierz
Дата:
Сообщение: Linux user www-data has no access to amphora2 DB_New