X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 36B15475AE4 for ; Wed, 30 Apr 2003 13:08:32 -0400 (EDT) Received: from c001.snv.cp.net (h007.c001.snv.cp.net [209.228.32.121]) by postgresql.org (Postfix) with SMTP id 480C8475A45 for ; Wed, 30 Apr 2003 13:08:31 -0400 (EDT) Received: (cpmta 21129 invoked from network); 30 Apr 2003 10:08:29 -0700 Received: from 209.228.32.128 (HELO mail.dilger.cc.criticalpath.net) by smtp.register-admin.com (209.228.32.121) with SMTP; 30 Apr 2003 10:08:29 -0700 X-Sent: 30 Apr 2003 17:08:29 GMT Received: from [207.25.88.117] by mail.dilger.cc with HTTP; Wed, 30 Apr 2003 10:08:28 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 7bit MIME-Version: 1.0 To: jdiehl@sandia.gov Cc: pgsql-sql@postgresql.org, pgsql-performance@postgresql.org From: "Nikolaus Dilger" Subject: Re: Like search performance. X-Sent-From: nikolaus@dilger.cc Date: Wed, 30 Apr 2003 10:08:28 -0700 (PDT) X-Mailer: Web Mail 5.3.1-0_sol28 Message-Id: <20030430100829.9198.h014.c001.wm@mail.dilger.cc.criticalpath.net> X-Spam-Status: No, hits=-13.7 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,QUOTE_TWICE_1 autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/267 X-Sequence-Number: 1773 Jeffrey, The best thing you can do is to have the wildcard % as late as possible in your search condition. So do like 'd%' instead of like '%d%' if you can. Regards, Nikolaus On Wed, 30 Apr 2003 10:34:40 -0600, "Diehl, Jeffrey" wrote: > > Hi all, > > I have a fairly large table with a char(20) field in it > which I search on > quite a bit. The problem is that I tend to do a lot of > "...where field like '%-d%'" type searches on this > field. > > Is there any to speed up this type of search? > > TIA, > > Mike Diehl. > > > ---------------------------(end of > broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster