Re: index and seq scan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: index and seq scan
Дата
Msg-id 22181.1010692611@sss.pgh.pa.us
обсуждение исходный текст
Ответ на index and seq scan  (Tina Messmann <tina.messmann@xinux.de>)
Список pgsql-general
Tina Messmann <tina.messmann@xinux.de> writes:
> [ appid < 10 uses an index, appid > 10 does not ]

This is not wrong.  An indexscan only wins over a sequential scan if the
indexscan can scan a fairly small percentage of the table --- the
critical percentage varies, but let's say it's 5%.  If appid < 10
selects less than 5% of the table, then appid > 10 must select more than
95% of the table.  Accordingly, choosing a seqscan for the second query
is the right thing to do.

            regards, tom lane

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

Предыдущее
От: Jason Earl
Дата:
Сообщение: Re: index and seq scan
Следующее
От: Jim Martinez
Дата:
Сообщение: duplicating tables (accross databases)