Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DF257650142 for ; Fri, 5 Sep 2008 14:26:07 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 93909-04-3 for ; Fri, 5 Sep 2008 14:26:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.187]) by postgresql.org (Postfix) with ESMTP id A43FE65016F for ; Fri, 5 Sep 2008 14:26:01 -0300 (ADT) Received: by fk-out-0910.google.com with SMTP id e30so380622fke.3 for ; Fri, 05 Sep 2008 10:25:59 -0700 (PDT) Received: by 10.180.254.18 with SMTP id b18mr9412319bki.43.1220635559465; Fri, 05 Sep 2008 10:25:59 -0700 (PDT) Received: from ?80.222.42.69? ( [80.222.42.69]) by mx.google.com with ESMTPS id h1sm330401nfh.19.2008.09.05.10.25.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Sep 2008 10:25:58 -0700 (PDT) Message-ID: <48C16BA4.2060407@enterprisedb.com> Date: Fri, 05 Sep 2008 20:25:56 +0300 Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509) MIME-Version: 1.0 To: Tom Lane CC: David Rowley , 'Peter Eisentraut' , pgsql-patches@postgresql.org Subject: Re: [HACKERS] TODO item: Implement Boyer-Moore searching (First time hacker) References: <2F2A1443F6064162BECA6BB37625222E@amd64> <27136.1220634737@sss.pgh.pa.us> In-Reply-To: <27136.1220634737@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Heikki Linnakangas X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/58 X-Sequence-Number: 7073 Tom Lane wrote: > "David Rowley" writes: >> Tom Lane wrote: >>> Hmm. B-M-H has worst case search speed O(M*N) (where M = length of >>> pattern, N = length of search string); whereas full B-M is O(N). Maybe we >>> should build the second table when M is large? > >> I'll look into this. If it pays off for longer searches I'll submit a patch. >> I won't have the time until after the 15th, so perhaps that's in November's >> commit fest? > > Yes. Let's get B-M-H in during this fest and then you can look into > whether a follow-on patch is worthwhile. Agreed. Also, it would be nice to use B-M(-H) for LIKE as well. That's a different codepath, but probably more widely used than textpos and frients. I haven't looked how feasible it would be to do, though. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com