Re: best index for ~ ordering?

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: best index for ~ ordering?
Дата
Msg-id 20070306222802.GA16606@phlogiston.dyndns.org
обсуждение исходный текст
Ответ на best index for ~ ordering?  (Gerardo Herzig <gherzig@fmed.uba.ar>)
Ответы Re: best index for ~ ordering?
Список pgsql-sql
On Tue, Mar 06, 2007 at 06:34:23PM -0300, Gerardo Herzig wrote:
> Hi all, i have a large table with one varchar field, and im triyng to 
> get information about what index should i use in order to using that 
> index (if this is possible) for ~ searching, and/or using LIKE searching.

What sort of match are you doing?  If you're doing left-anchored
searches (LIKE 'blah%') then your standard btree is good.  If you're
doing unanchored searches (LIKE '%blah%' or similar) you're best doing
tsearch.  If it's right-anchored, you can do an index on the reverse
of the string.

A 

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Unfortunately reformatting the Internet is a little more painful 
than reformatting your hard drive when it gets out of whack.    --Scott Morris


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

Предыдущее
От: Gerardo Herzig
Дата:
Сообщение: best index for ~ ordering?
Следующее
От: calendarw
Дата:
Сообщение: Re: How to union table without union statement?