Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 80560650170 for ; Thu, 11 Sep 2008 04:51:10 -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 21867-02-5 for ; Thu, 11 Sep 2008 04:51:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by postgresql.org (Postfix) with ESMTP id 6565564FD01 for ; Thu, 11 Sep 2008 04:20:56 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 29so747217ugo.7 for ; Thu, 11 Sep 2008 00:20:53 -0700 (PDT) Received: by 10.210.128.5 with SMTP id a5mr2881477ebd.50.1221117653379; Thu, 11 Sep 2008 00:20:53 -0700 (PDT) Received: from ?80.222.42.69? ( [80.222.42.69]) by mx.google.com with ESMTPS id k5sm7431820nfd.22.2008.09.11.00.20.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Sep 2008 00:20:52 -0700 (PDT) Message-ID: <48C8C6D2.2010809@enterprisedb.com> Date: Thu, 11 Sep 2008 10:20:50 +0300 Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509) MIME-Version: 1.0 To: David Rowley CC: 'Tom Lane' , 'Peter Eisentraut' , pgsql-hackers@postgresql.org Subject: Re: [PATCHES] TODO item: Implement Boyer-Moore searching (First time hacker) References: <17EF6EF77BD7405E86761C688A73BAB4@amd64> In-Reply-To: <17EF6EF77BD7405E86761C688A73BAB4@amd64> 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/756 X-Sequence-Number: 123885 David Rowley wrote: > The thing that surprised me was that string_to_array didn't perform as well. > I expected single character searches to perform a little better. I can't > think why it would be slower now. Yes, that's strange. I tried to reproduce that here, with a CVS snapshot before the patch, and after. With quick testing with psql and \timing and the same query you had in that spreadsheet, I couldn't see that kind of performance degradation. Oprofile suggests that, on the contrary, slightly less time is spent in text_position_next() after the patch, and slightly more in text_position_setup(). Together they account for ~10% of CPU time in both tests, so a small difference there would be insignificant anyway in that test case. I think we're fine. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com