Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 0EC879FB768 for ; Fri, 25 May 2007 14:08:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 18008-03 for ; Fri, 25 May 2007 14:08:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id D5E019FB2EA for ; Fri, 25 May 2007 14:08:05 -0300 (ADT) Received: from [192.168.1.238] (or-76-2-4-105.dhcp.embarqhsd.net [76.2.4.105]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l4PH6mNv016157; Fri, 25 May 2007 10:06:48 -0700 Message-ID: <465717A6.4040503@commandprompt.com> Date: Fri, 25 May 2007 10:06:46 -0700 From: "Joshua D. Drake" User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: mark@mark.mielke.cc CC: Richard Huxton , Mark Lewis , James Mansion , Magnus Hagander , Alexander Staubo , Andy , pgsql-performance@postgresql.org Subject: Re: LIKE search and performance References: <009501c79d4c$445428f0$0b00a8c0@mpsro.dom> <88daf38c0705230905u1a981102k691b47bd36011a80@mail.gmail.com> <4655DE75.4080506@mansionfamily.plus.com> <4655E64B.5050503@hagander.net> <4655FB8A.1040707@mansionfamily.plus.com> <1180040560.31471.262.camel@archimedes> <20070524215450.GA3858@mark.mielke.cc> <46569AA5.10205@archonet.com> <20070525141630.GA12162@mark.mielke.cc> <4657023A.20209@archonet.com> <20070525165633.GA13579@mark.mielke.cc> In-Reply-To: <20070525165633.GA13579@mark.mielke.cc> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.88.5, clamav-milter version 0.88.5 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Fri, 25 May 2007 10:06:53 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/523 X-Sequence-Number: 24913 mark@mark.mielke.cc wrote: > I am speaking of contains, as contains is the one that was said to > require a seqscan. I am questioning why it requires a seqscan. The > claim was made that with MVCC, the index is insufficient to check > for visibility and that the table would need to be accessed anyways, > therefore a seqscan is required. I question whether a like '%bar%' > should be considered a high selectivity query in the general case. > I question whether a worst case should be assumed. If you are doing %bar% you should be using pg_tgrm or tsearch2. J > > Perhaps I question too much? :-) > > Cheers, > mark >