Re: Use of index for 50% column restriction

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Use of index for 50% column restriction
Дата
Msg-id 2416.1465406934@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Use of index for 50% column restriction  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Use of index for 50% column restriction  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> As part of my research on the parsing/planning behavior of PREPARE, I
> found a surprising behavior --- a WHERE clause that is 50% restrictive
> is using an index.  I thought only <10% restrictions used indexes.

There's no such hard-and-fast rule.  The cost estimate break point depends
greatly on the index order correlation (which is 100% in your example),
as well as some other factors like the index size versus
effective_cache_size.

For randomly-ordered data I believe the cutover is actually well below 10%.
        regards, tom lane



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Use of index for 50% column restriction
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <