Re: TODO item: Implement Boyer-Moore searching in LIKE queries

From: Karan Sikka <karanssikka(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TODO item: Implement Boyer-Moore searching in LIKE queries
Date: 2016-08-01 23:47:49
Message-ID: CALkFZpeHnyBZWTWxC+ospSWLumOwV2-QeK=iE=X9zOySGiL=uA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I agree, should we remove it from the TODO list?

On Mon, Aug 1, 2016 at 6:13 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Mon, Aug 1, 2016 at 1:19 PM, Karan Sikka <karanssikka(at)gmail(dot)com> wrote:
> > Following the patch to implement strpos with Boyer-Moore-Horspool,
> > it was proposed we bring BMH to LIKE as well.
> >
> > Original thread:
> >
> https://www.postgresql.org/message-id/flat/27645(dot)1220635769%40sss(dot)pgh(dot)pa(dot)us#27645(dot)1220635769(at)sss(dot)pgh(dot)pa(dot)us
> >
> > I'm a first time hacker and I found this task on the TODO list. It seemed
> > interesting and isolated enough. But after looking at the code in
> > like_match.c, it's clearly a non-trivial task.
> >
> > How desirable is this feature? To begin answering that question,
> > I did some initial benchmarking with an English text corpus to find how
> much
> > faster BMH (Boyer-Moore-Horspool) would be compared to LIKE, and the
> results
> > were as follows: BMH can be up to 20% faster than LIKE, but for short
> > substrings, it's roughly comparable or slower.
> >
> > Here are the results visualized:
> >
> > http://ctrl-c.club/~ksikka/pg/like-strpos-short-1469975400.png
> > http://ctrl-c.club/~ksikka/pg/like-strpos-long-1469975400.png
>
> Based on these results, this looks to me like a pretty unexciting
> thing upon which to spend time.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-08-02 01:10:54 Re: New version numbering practices
Previous Message Tom Lane 2016-08-01 23:42:28 Re: PostmasterContext survives into parallel workers!?