X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D10779FA5DD for ; Fri, 9 Jun 2006 13:24:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 59222-02 for ; Fri, 9 Jun 2006 13:24:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from projects.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id 292459FA1A8 for ; Fri, 9 Jun 2006 13:24:50 -0300 (ADT) Received: from [192.168.1.50] (or-67-76-146-141.sta.sprint-hsd.net [67.76.146.141]) (authenticated bits=0) by projects.commandprompt.com (8.13.6/8.13.6) with ESMTP id k59GOonj003086; Fri, 9 Jun 2006 09:24:50 -0700 Message-ID: <4489A0CF.2080309@commandprompt.com> Date: Fri, 09 Jun 2006 09:24:47 -0700 From: "Joshua D. Drake" Organization: Command Prompt, Inc. User-Agent: Thunderbird 1.5.0.2 (X11/20060521) MIME-Version: 1.0 To: Chris Hoover CC: "pgsql-admin@postgresql.org" Subject: Re: Best way to index large text/varchar fields References: <1d219a6f0606090845q62fad204m95e526effb35fba1@mail.gmail.com> In-Reply-To: <1d219a6f0606090845q62fad204m95e526effb35fba1@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.2, clamav-milter version 0.88.2 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (projects.commandprompt.com [192.168.2.159]); Fri, 09 Jun 2006 09:24:51 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/78 X-Sequence-Number: 22040 Chris Hoover wrote: > In 8.1, what is the best way to index large text/varchar fields for wild > card searches? > > I am getting good number of queries being submitted for reporting > purposes that are doing the following - where like > '%some phrase%' and .... > Is there a good way to index these fields so that the db engine will use > and index? If you are indeed using phrases, and thus paragraphs of text, you should look into Tsearch2. Joshua D. Drake > > Thanks, > > Chris -- === The PostgreSQL Company: Command Prompt, Inc. === Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240 Providing the most comprehensive PostgreSQL solutions since 1997 http://www.commandprompt.com/