Re: Index Question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Index Question
Дата
Msg-id 5343.1255964088@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Index Question  ("Bierbryer, Andrew" <abierbryer@klsdiversified.com>)
Список pgsql-general
"Bierbryer, Andrew" <abierbryer@klsdiversified.com> writes:
> I have created a table where a unique row is defined by 5 columns and
> have created an index on these 5 columns. If I then do a select with a
> where clause that only consists of 3 of these columns, will I get the
> speed benefits from the index that I have created, or will I need to
> create another index with only these 3 columns?

It should work fine if those are the three leading columns of the index.
If they're not, you might want another index.  This is not specific at
all to unique keys, it's a general property of multicolumn indexes.
Read
http://www.postgresql.org/docs/8.4/static/indexes.html
particularly 11.3 and 11.5

            regards, tom lane

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

Предыдущее
От: "Bierbryer, Andrew"
Дата:
Сообщение: Index Question
Следующее
От: Greg Smith
Дата:
Сообщение: Re: Best practices for effective_io_concurrency