From: | Sergey Zeleniy <1(at)1plus1(dot)net> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | VARCHAR & INDEXES. Context search. Need help. |
Date: | 1999-06-03 08:19:39 |
Message-ID: | 37563A9B.32A3DE7A@1plus1.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 ).
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 1999-06-03 10:24:16 | Re: [SQL] Are PL/pgSQL calls atomic? |
Previous Message | Herbert Ambos | 1999-06-03 01:40:54 | RE: [SQL] Column name's length |