From: David Rowley <dgrowley@gmail.com>
To: 'Heikki Linnakangas' <heikki.linnakangas@enterprisedb.com>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: 'Peter Eisentraut' <peter_e@gmx.net>
Cc: pgsql-patches@postgresql.org
Subject: Re: [HACKERS] TODO item: Implement Boyer-Moore searching (First time hacker)
Date: Mon, 8 Sep 2008 20:19:35 +0100
Message-ID: <0D0F8DC5EE1341A199B5BDA73F870BA7@amd64> (raw)
In-Reply-To: <48C4C9FE.20905@enterprisedb.com>
Heikki Linnakangas Wrote:
> Tom Lane wrote:
> > Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> >> Also, it would be nice to use B-M(-H) for LIKE as well.
> >
> > Right offhand, that seems impossible, at least in patterns with %.
> > Or were you thinking of trying to separate out the fixed substrings
> > of a pattern and search for them with BMH?
> Yep, something like that. Even if it only handled the special case of
> '%foobar%', that would be nice, because that's a pretty common special
> case.
It would be a quick test to check for % at either end. But we'd also need to
ensure there were none in the middle. That might slow it down. I guess while
looping over the inner chars checking for more %'s we could be building a
skiptable. We'd have to abort it if we found any %'s of course
I think with out giving it much thought _'s could be handled by BMH, these
could just be given a skip distance of 2. Only having a lossy skip table
throws that out the window without having a special check for _
David.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-patches@postgresql.org
Cc: dgrowley@gmail.com, heikki.linnakangas@enterprisedb.com, tgl@sss.pgh.pa.us, peter_e@gmx.net
Subject: Re: [HACKERS] TODO item: Implement Boyer-Moore searching (First time hacker)
In-Reply-To: <0D0F8DC5EE1341A199B5BDA73F870BA7@amd64>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox