Re: Index only scan sometimes switches to sequential scan for small amount of rows

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Index only scan sometimes switches to sequential scan for small amount of rows
Дата
Msg-id 7439.1427304380@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Index only scan sometimes switches to sequential scan for small amount of rows  (Feike Steenbergen <feikesteenbergen@gmail.com>)
Ответы Re: Index only scan sometimes switches to sequential scan for small amount of rows  (Feike Steenbergen <feikesteenbergen@gmail.com>)
Список pgsql-performance
Feike Steenbergen <feikesteenbergen@gmail.com> writes:
> On 25 March 2015 at 13:45, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
>>> We can also increase the 'Stats target' for this table, which will
>>> cause the statistics to contain information about 'NOT_YET_PRINTED'
>>> more often, but even then, it may not find any of these records, as
>>> they sometimes do not exist.

>> This is a better solution, IMHO.

> We'll have a go at this, also if what you say about values having to
> appear at least twice, the other values may make it into
> most_common_*, which would make it clearer to us.

In principle increasing the stats target should fix this, whether or not
'NOT_YET_PRINTED' appears in the MCV list after any particular analyze;
because what will happen is that the frequency for 'PRINTED' will more
nearly approach 1, and so the estimated selectivity for other values
will drop even if they're not in the list.

            regards, tom lane


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

Предыдущее
От: Feike Steenbergen
Дата:
Сообщение: Re: Index only scan sometimes switches to sequential scan for small amount of rows
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Index only scan sometimes switches to sequential scan for small amount of rows