Re: Two indexes on same column

Поиск
Список
Период
Сортировка
От Raghavendra
Тема Re: Two indexes on same column
Дата
Msg-id CA+h6Ahh=DRGgqTOO52_ko6ucV3OhOojaCBvojVtvJ-_oZPAudw@mail.gmail.com
обсуждение исходный текст
Ответ на Two indexes on same column  (Vlastimil Krejcir <krejcir@ics.muni.cz>)
Ответы Re: Two indexes on same column  (Ernesto Quiñones <ernestoq@gmail.com>)
Список pgsql-general

On Wed, Jul 20, 2011 at 2:39 PM, Vlastimil Krejcir <krejcir@ics.muni.cz> wrote:
 Hi,

 what index is used (and according to what rules) when there are two (or more) different indexes defined on one column? Assume:

CREATE TABLE example (
id SERIAL PRIMARY KEY,
...);
CREATE INDEX example_id_idx ON example USING hash (id);

By default there are btree index created and the hash index is then created. So there are two indexes on column "id". Are there described somewhere what index is used and when? Does it depend on query analyzer and planner?

Thanks


You are right, depends on the optimizer and query to which index to choose. EXPLAIN command on the query will give you the optimizer path.

---
Regards,
Raghavendra
EnterpriseDB Corporation


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

Предыдущее
От: Vlastimil Krejcir
Дата:
Сообщение: Two indexes on same column
Следующее
От: Rebecca Clarke
Дата:
Сообщение: Error creating function