| От | Tom Lane |
|---|---|
| Тема | Re: Help with LIKE |
| Дата | |
| Msg-id | 8915.1048212381@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Help with LIKE (Josh Berkus <josh@agliodbs.com>) |
| Список | pgsql-performance |
Josh Berkus <josh@agliodbs.com> writes: >> SELECT * FROM table WHERE url ~ '^http://.*something.*$'; > That search still requires a seq scan, since it has "gaps" in the seqence of > characters. That is, > url ~ '^http://www.something.*' could use an index, but your search above > cannot. Actually, it *can* use an index ... but the index condition will only use the characters before the ".*", ie, "http://". Which is just about useless if you're searching a column of URLs :-( I agree that tsearch or OpenFTS are the tools to be looking at. regards, tom lane
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера