Re: Is it possible to search for sub-strings...
От | Steve Heaven |
---|---|
Тема | Re: Is it possible to search for sub-strings... |
Дата | |
Msg-id | 3.0.1.32.20000919170639.00e6207c@mail.thornet.co.uk обсуждение исходный текст |
Ответ на | Re: Is it possible to search for sub-strings... ("Mitch Vincent" <mitch@venux.net>) |
Ответы |
Re: Is it possible to search for sub-strings...
|
Список | pgsql-general |
At 09:00 19/09/00 -0700, Mitch Vincent wrote: >LIKE can use indexes, ~* can not, that's LIKE's main advantage (at least in >my opinion). > ~ does use indexes, ~* doesnt, but then nor does the equivalent upper(columnname) LIKE 'TERM'. Make sure you're comparing apples with apples. explain select * from all_title_fti where string like 'A%'; NOTICE: QUERY PLAN: Index Scan using all_title_idx on all_title_fti (cost=86633.57 rows=1 width=16) explain select * from all_title_fti where string ~ '^A'; NOTICE: QUERY PLAN: Index Scan using all_title_idx on all_title_fti (cost=86633.57 rows=1 width=16 explain select * from all_title_fti where upper(string) like 'A%'; NOTICE: QUERY PLAN: Seq Scan on all_title_fti (cost=170921.58 rows=1083414 width=16) -- thorNET - Internet Consultancy, Services & Training Phone: 01454 854413 Fax: 01454 854412 http://www.thornet.co.uk
В списке pgsql-general по дате отправления: