VARCHAR & INDEXES. Context search. Need help. - Mailing list pgsql-sql

From Sergey Zeleniy
Subject VARCHAR & INDEXES. Context search. Need help.
Date
Msg-id 37563A9B.32A3DE7A@1plus1.net
Whole thread Raw
List 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 by date:

Previous
From: Vadim Mikheev
Date:
Subject: Re: [SQL] Are PL/pgSQL calls atomic?
Next
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [SQL] Are PL/pgSQL calls atomic?