VARCHAR & INDEXES. Context search. Need help.

Поиск
Список
Период
Сортировка
От Sergey Zeleniy
Тема VARCHAR & INDEXES. Context search. Need help.
Дата
Msg-id 37563A9B.32A3DE7A@1plus1.net
обсуждение исходный текст
Список pgsql-sql
Hello All!

I have the following table in my database:

+------------+--------------+
|timecode    | time         |
|description | varchar(250) |
+------------+--------------+

Values of a field "description" looks like "word1 word2 word3...",
"word3 word1 word20...", ...
I need to make queries of the next type:

SELECT <fileds> FROM <table> WHERE description ~* "wordN"

That is get all rows, where the word "wordN" join in string.
But in this case occurs full scan of the table. In the table there are
only ~20000 records, but the search is carried out ~20(!!!) seconds.
It is very long!!! Indexes don't work.
Help me, please, solve this problem!

Thanks.

PS: In the table the records are periodically added...

-- 
With Best Regards, 
Sergio ( Green ).


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

Предыдущее
От: Vadim Mikheev
Дата:
Сообщение: Re: [SQL] Are PL/pgSQL calls atomic?
Следующее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [SQL] Are PL/pgSQL calls atomic?