| От | Tom Lane |
|---|---|
| Тема | Re: Question about index usage |
| Дата | |
| Msg-id | 18453.1141743878@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Question about index usage (Guido Neitzer <guido.neitzer@pharmaline.de>) |
| Ответы |
Re: Question about index usage
|
| Список | pgsql-general |
Guido Neitzer <guido.neitzer@pharmaline.de> writes:
> Is there a reason why this query:
> select id from dga_dienstleister where plz in ('45257', '45259');
> doesn't use this index:
> "dga_dienstleister_plz_index" btree (plz varchar_pattern_ops)
> but uses this index:
> "dga_dienstleister_plz_index2" btree (plz)
Because IN means "=", which is a member of the index opclass for the
second index but not the first.
Why do you care? Should be about the same result either way.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера