Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 5F0B79FB309 for ; Wed, 6 Jun 2007 19:27:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 57809-06 for ; Wed, 6 Jun 2007 19:27:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by postgresql.org (Postfix) with ESMTP id 242A59FB2DA for ; Wed, 6 Jun 2007 19:27:38 -0300 (ADT) Received: from [80.229.150.39] (helo=mansionfamily.plus.com) by ptb-relay03.plus.net with esmtp (Exim) id 1Hw3ya-0000Ld-0K for pgsql-performance@postgresql.org; Wed, 06 Jun 2007 23:27:36 +0100 Received: from [192.168.0.87] ([192.168.0.87]:4639) by mansionfamily.plus.com with [XMail 1.22 ESMTP Server] id for from ; Wed, 6 Jun 2007 23:21:12 +0100 Message-ID: <466733D1.1040308@mansionfamily.plus.com> Date: Wed, 06 Jun 2007 23:23:13 +0100 From: James Mansion User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: mark@mark.mielke.cc CC: Mark Lewis , 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> In-Reply-To: <20070524215450.GA3858@mark.mielke.cc> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/113 X-Sequence-Number: 25146 mark@mark.mielke.cc wrote: > What is a real life example where an intelligent and researched > database application would issue a like or ilike query as their > primary condition in a situation where they expected very high > selectivity? > In my case the canonical example is to search against textual keys where the search is performed automatically if the user hs typed enough data and paused. In almost all cases the '%' trails, and I'm looking for 'starts with' in effect. usually the search will have a specified upper number of returned rows, if that's an available facility. I realise in this case that matching against the index does not allow the match count unless we check MVCC as we go, but I don't see why another thread can't be doing that. James