RE: Need to improve performance

Поиск
Список
Период
Сортировка
От Andrew Snow
Тема RE: Need to improve performance
Дата
Msg-id NHEALMDKDACEIPBNOOOCMEDHCGAA.als@fl.net.au
обсуждение исходный текст
Ответ на Need to improve performance  (Vassili A Akimov <vassili@erols.com>)
Список pgsql-general

> So we were advised to use "fulltextindex".- chunk
> this fields on single words and make new table with words and oids in
> it. After we made this table its size was 2940360 records. And I tried
> to measure the time:
>
>  ....
>
> select f1.id from app_fti f1, app_fti f2 where f1.string~*'visual' and
> f2.string~*'basic' and f1.id=f2.id;

What is causing it to be so slow is the use of regular expression pattern
matching.  For reasons I don't know, regular expression evaluation in a
query is fairly slow in PostgreSQL.  But since you have (correctly, I think)
made a full text index, why do you still need to use regexp's ?

Replace the ~* operator in the query above with 'LIKE', and you should find
it several times faster.

Please let us know the results of your testing.



- Andrew




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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: app-index in www.pgsql.com
Следующее
От: Joseph Shraibman
Дата:
Сообщение: Is this still true?