Re: [HACKERS] Use of Indicies ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Use of Indicies ...
Дата
Msg-id 14946.948693518@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Use of Indicies ...  (The Hermit Hacker <scrappy@hub.org>)
Ответы Re: [HACKERS] Use of Indicies ...  (The Hermit Hacker <scrappy@hub.org>)
Список pgsql-hackers
The Hermit Hacker <scrappy@hub.org> writes:
> There is an index on all three conditions in the WHERE clause:
> Yet EXPLAIN shows:
> Aggregate  (cost=2.05 rows=1 width=4)
-> Index Scan using referrer_link_counter_id on referrer_link  (cost=2.05 rows=1 width=4)

> Why does EXPLAIN only show the use of one of the indices, why counter_id
> and why not all three?

Indexscans only know how to use one index at a time.

The optimizer picked the counter_id index out of the three available
choices because it thought that would be the cheapest (most selective)
alternative --- or, if the computed selectivities were all the same,
just because it happened to try that one first.

Do you have reason to think that one of the other indexes would have
been cheaper?
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Happy column dropping
Следующее
От: Chris Bitmead
Дата:
Сообщение: Re: ORDBMS<->OID (Re: [HACKERS] Happy column dropping)