Re: postgres index on ILIKE

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: postgres index on ILIKE
Дата
Msg-id 200309291009.31470.josh@agliodbs.com
обсуждение исходный текст
Список pgsql-sql
Alex,

> mydb=# explain select filename from neighbors where filename ilike
> '%test%'; QUERY PLAN
> -------------------------------------------------------------
>   Seq Scan on neighbors  (cost=0.00..17449.64 rows=774 width=37)
>     Filter: ((filename)::text ~~* '%test%'::text)

I just looked at your query.   What you have above is an "unanchored text 
search", where you are looking for a snippet of text anywhere in the field.   
Such a search *cannot* be indexed using a regular index.

Instead, you need to employ the TSearch full text searching module for 
PostgreSQL.    
hmmm ... the Tsearch home page appears to be down.  Check out the readme in 
your postgreSQL source code:  PG_SOURCE/contrib/tsearch/readme
-- 
Josh Berkus
Aglio Database Solutions
San Francisco


В списке pgsql-sql по дате отправления:

Предыдущее
От: "shengqj"
Дата:
Сообщение: help
Следующее
От: teknokrat
Дата:
Сообщение: does postgresql execute unions in parallel?