| От | Tom Lane |
|---|---|
| Тема | Re: Partial indexes |
| Дата | |
| Msg-id | 19372.1145398867@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Partial indexes (elein <elein@varlena.com>) |
| Ответы |
Re: Partial indexes
|
| Список | pgsql-general |
elein <elein@varlena.com> writes:
> I think I want to:
> create unique index pk on table tbl (keyp1, keyp2);
> create unique index range on table tbl (keyp1, keyp2, keyp3) where keyp3 is not null;
> Are these indexes redundant given uniqueness requirement and the type of queries
> that will be run against the table?
If all (keyp1, keyp2) pairs are distinct then I see no particular use in
the second index; it doesn't check anything that's not implied by the
first index, and it doesn't offer any extra search selectivity either.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера