Re: Multiple column index usage question

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Multiple column index usage question
Дата
Msg-id 20070120051208.GA16159@wolff.to
обсуждение исходный текст
Ответ на Re: Multiple column index usage question  ("Jeremy Haile" <jhaile@fastmail.fm>)
Список pgsql-general
On Fri, Jan 19, 2007 at 18:20:47 -0500,
  Jeremy Haile <jhaile@fastmail.fm> wrote:
> That's interesting.  So if you have a composite index on two columns, is
> there much of a reason (usually) to create single indexes on each of the
> two columns?  I guess the single indexes might be slightly faster
> depending on the number of different values/combinations, so probably
> "it depends" eh?

You are normal going to want an index on just the second column in the
index or you do things where you are selecting a small subset of rows
based on the value of that column.

In some situations it may even make sense to have a separate index on just
the first column, because it will be more compact which will speed up
searches. However, you have to pay for maintaining the extra index when
changing the data so it often isn't worth it.

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

Предыдущее
От: "Kelly Burkhart"
Дата:
Сообщение: Re: Alter definition of a column
Следующее
От: "Matthew T. O'Connor"
Дата:
Сообщение: Re: Help : Microsoft SQL Server equivalents in