Re: Speeding up text_position_next with multibyte encodings

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: John Naylor <jcnaylor(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Speeding up text_position_next with multibyte encodings
Date: 2018-12-23 00:45:05
Message-ID: 505c447a-5e2a-2c0d-becc-c9bd2a7ebc2f@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23/12/2018 02:32, Heikki Linnakangas wrote:
> On 23/12/2018 02:28, Heikki Linnakangas wrote:
>> On 14/12/2018 23:40, John Naylor wrote:
>>> I just noticed that the contrib/citext test fails. I've set the status
>>> to waiting on author.
>>
>> Hmm, it works for me. What failure did you see?
>
> Never mind, I'm seeing it now, with assertions enabled. Thanks, I'll
> investigate!

The bug was in handling empty inputs. text_position_setup assumed and
asserted that neither the needle nor haystack are empty, expecting the
callers to have handled those special cases already, but not all callers
did. Here is a fixed version.

- Heikki

Attachment Content-Type Size
0001-Use-single-byte-Boyer-Moore-Horspool-search-even-wit-2.patch text/x-patch 24.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2018-12-23 01:49:58 Make relcache init write errors not be fatal
Previous Message Michael Paquier 2018-12-23 00:41:03 Re: Offline enabling/disabling of data checksums