| От | Mario Weilguni |
|---|---|
| Тема | Re: optimizing LIKE '%2345' queries |
| Дата | |
| Msg-id | 200607030933.53373.mweilguni@sime.com обсуждение |
| Ответ на | optimizing LIKE '%2345' queries (Gene <genekhart@gmail.com>) |
| Ответы |
Is postgresql ca do the job for software deployed in ASP ou SaaS mode?
|
| Список | pgsql-performance |
Am Sonntag, 2. Juli 2006 23:50 schrieb Gene:
> Is there any way to create a reverse index on string columns so that
> queries of the form:
>
> where column like '%2345';
>
> can use an index and perform as fast as searching with like '2345%'?
>
> Is the only way to create a reverse function and create an index using
> the reverse function and modify queries to use:
>
> where reverse(column) like reverse('%2345') ?
>
> thanks
create a trigger that computes this at insert/update time, index this fix, and
rewrite the query this way:
where inverted_column like '5432%';
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера