Is unique index always used if query is on first constituent column ?

Поиск
Список
Период
Сортировка
От Rajesh Kumar Mallah
Тема Is unique index always used if query is on first constituent column ?
Дата
Msg-id a97c77030612300238j47f7e52bxb23fe644f0046094@mail.gmail.com
обсуждение исходный текст
Ответы Re: Is unique index always used if query is on first constituent column ?
Список pgsql-admin
Hi,

suppose we have  2 columns a and b  . we need to query by a and sometimes
by b  for data consistency UNIQUE(a,b) also needs to be there. we create
indexes below:

create unique index ab on t(a,b);
create index b on t(b);

it has been observed that index ab is used while querying
for a , can we always avoid creating the extra index on a ie,
create index a on t(a); (does other databases also behave
similar?)

Regds
mallah.

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

Предыдущее
От: "Andy Shellam (Mailing Lists)"
Дата:
Сообщение: Re: Frustrating LO problem
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Is unique index always used if query is on first constituent column ?