Single vs. multiple indexes

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Single vs. multiple indexes
Дата
Msg-id 2366.900002129@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: [SQL] Single vs. multiple indexes  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-sql
Question: what's the difference between making a single index covering
multiple fields of the underlying table, and making a separate index
for each of the fields?

I understand that the semantics are different if I create a UNIQUE
index: a unique index on a field enforces that every record in the table
have a different value of that field, but a unique index on a set of
fields only enforces that the combination of all those fields be unique
in each record.

Leaving that aside, what are the performance implications?  Does one
structure support fast execution of query types that the other doesn't,
and if so which one's better for what?  Is a single index cheaper to
update than multiple indexes?  Does it save disk space?

            regards, tom lane

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

Предыдущее
От: "Stephen Horton"
Дата:
Сообщение: Newby Postgres questions
Следующее
От: Tom Lane
Дата:
Сообщение: Indexes and inheritance (and access rights)