Received: from netadmin.1plus1.net (root@ns.1plus1.net [194.93.173.130]) by hub.org (8.9.3/8.9.3) with ESMTP id EAA05376 for ; Thu, 3 Jun 1999 04:15:42 -0400 (EDT) (envelope-from sergio@1plus1.net) Received: from helix.1plus1.net (root@helix.1plus1.net [10.6.2.201]) by netadmin.1plus1.net (8.9.3/8.9.2) with ESMTP id LAA78059 for ; Thu, 3 Jun 1999 11:15:33 +0300 (EEST) Received: from 1plus1.net (elf.1plus1.net [10.6.2.4]) by helix.1plus1.net (8.9.3/8.9.3) with ESMTP id LAA00476 for ; Thu, 3 Jun 1999 11:15:33 +0300 (EEST) Message-ID: <37563A9B.32A3DE7A@1plus1.net> Date: Thu, 03 Jun 1999 11:19:39 +0300 From: Sergey Zeleniy <1@1plus1.net> Organization: 1+1 Studio X-Mailer: Mozilla 4.06 [en] (Win98; I) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: VARCHAR & INDEXES. Context search. Need help. Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit 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 FROM 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 ).