Re: How planner decides left-anchored LIKE can use index
В списке pgsql-performance по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: How planner decides left-anchored LIKE can use index |
| Дата | |
| Msg-id | 6716.1189124896@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | How planner decides left-anchored LIKE can use index ("Carlo Stonebanks" <stonec.register@sympatico.ca>) |
| Список | pgsql-performance |
"Carlo Stonebanks" <stonec.register@sympatico.ca> writes:
> There is an index on lower(last_name). I have seen the planner convert the
> LIKE to lower(last_name) >= 'smith' and lower(last_name) < 'smiti' on 8.2.4
> systems, but a slow sequence scan and filter on 8.1.9 - is this related to
> the version difference (8.1.9 vs 8.2.4) or is this related to something like
> operators/classes that have been installed?
Most likely you used C locale for the 8.2.4 installation and some other
locale for the other one.
In non-C locale you can still get the optimization if you create an
index using the text_pattern_ops opclass ... but beware that this index
is useless for the normal locale-aware operators.
regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера