Re: Creating indexes

Поиск
Список
Период
Сортировка
От Matthew T. O'Connor
Тема Re: Creating indexes
Дата
Msg-id 475D71AA.2070707@tocr.com
обсуждение исходный текст
Ответ на Creating indexes  (Robert Fitzpatrick <lists@webtent.net>)
Список pgsql-general
Robert Fitzpatrick wrote:
> Now my question, would it be better to create one index with all columns
> in the table -or- a separate index for each column field? I was assuming
> the latter, but would the index with all columns be beneficial as well?


Generally it's much better to have an index deal with only one column.
Also I wouldn't just randomly throw an index on every column.  You
should only index the columns that used for the constraints.  You might
benefit from turning up the logging and looking at what queries are
slow, then play with them and viewing their explain output with /
without indexes.

Extra indexes that aren't really doing anything can actually hurt
performance during vacuum or insert / update / delete.

Matt


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

Предыдущее
От: Robert Fitzpatrick
Дата:
Сообщение: Creating indexes
Следующее
От: "Josh Harrison"
Дата:
Сообщение: slony question