Re: LIKE search and performance

Поиск
Список
Период
Сортировка
Искать
От
James Mansion
Тема
Re: LIKE search and performance
Дата
в 16:15:30
Msg-id
4655DE75.4080506@mansionfamily.plus.com
Ответ на
Список
Дерево обсуждения
LIKE search and performance "Andy" <frum@ar-sd.net>
Re: LIKE search and performance Richard Huxton <dev@archonet.com>
Re: LIKE search and performance Rigmor Ukuhe <rigmor.ukuhe@finestmedia.ee>
Re: LIKE search and performance "Andy" <frum@ar-sd.net>
Re: LIKE search and performance Guido Neitzer <lists@event-s.net>
Re: LIKE search and performance "Alexander Staubo" <alex@purefiction.net>
Re: LIKE search and performance James Mansion <james@mansionfamily.plus.com>
Re: LIKE search and performance Magnus Hagander <magnus@hagander.net>
Re: LIKE search and performance James Mansion <james@mansionfamily.plus.com>
Re: LIKE search and performance Mark Lewis <mark.lewis@mir3.com>
Re: LIKE search and performance mark@mark.mielke.cc
Re: LIKE search and performance Richard Huxton <dev@archonet.com>
Re: LIKE search and performance mark@mark.mielke.cc
Re: LIKE search and performance Richard Huxton <dev@archonet.com>
Re: LIKE search and performance mark@mark.mielke.cc
Re: LIKE search and performance "Joshua D. Drake" <jd@commandprompt.com>
Re: LIKE search and performance Richard Huxton <dev@archonet.com>
Re: LIKE search and performance Gregory Stark <stark@enterprisedb.com>
Re: LIKE search and performance Richard Huxton <dev@archonet.com>
Re: LIKE search and performance PFC <lists@peufeu.com>
Re: LIKE search and performance Richard Huxton <dev@archonet.com>
Re: LIKE search and performance PFC <lists@peufeu.com>
Re: LIKE search and performance Richard Huxton <dev@archonet.com>
Re: LIKE search and performance James Mansion <james@mansionfamily.plus.com>
Re: LIKE search and performance mark@mark.mielke.cc
Re: LIKE search and performance Craig James <craig_james@emolecules.com>
Re: LIKE search and performance Alvaro Herrera <alvherre@commandprompt.com>
Re: LIKE search and performance Craig James <craig_james@emolecules.com>
Re: LIKE search and performance PFC <lists@peufeu.com>
Alexander Staubo wrote:
> On 5/23/07, Andy  wrote:
>> An example would be:
>> SELECT * FROM table
>>                              WHERE name like '%john%' or street like 
>> '%srt%'
>>
>> Anyway, the query planner always does seq scan on the whole table and 
>> that
>> takes some time. How can this be optimized or made in another way to be
>> faster?
>
> There's no algorithm in existence that can "index" arbitrary
> substrings the way you think. The only rational way to accomplish this
> is to first break the text into substrings using some algorithm (eg.,
> words delimited by whitespace and punctuation), and index the
> substrings individually.
That seems rather harsh.  If I'd put an index on each of these colomns 
I'd certainly
expect it to use the indices - and I'm pretty sure that Sybase would.  
I'd expect
it to scan the index leaf pages instead of the table itself - they 
should be much
more compact and also likely to be hot in cache.

Why *wouldn't* the planner do this?

James

В списке pgsql-performance по дате отправления
От: Andy
Дата:
От: Magnus Hagander
Дата:
FAQ