Re: Possible solution for LIKE optimization - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Possible solution for LIKE optimization
Date
Msg-id 24084.997125325@sss.pgh.pa.us
Whole thread Raw
In response to RE: Possible solution for LIKE optimization  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Possible solution for LIKE optimization
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Hiroshi Inoue writes:
>> I'm not familiar with non_ASCII locale.
>> Is 'ss'  always guaranteed to be LIKE 's%'  for example ?

> Yes.  LIKE doesn't use any collation rules, since it doesn't do any
> collating.

On the other hand, LIKE *is* multibyte aware.  So the hypothetical
non-locale-aware comparison operators would need to be aware of
multibyte character sets even though not aware of locale.  And the
"add one" operator that we postulated for the LIKE index optimization
needs to be able to increment a multibyte character.

This seems doable, but the sort order of such a comparison function
might not be very pleasant, depending on what character set you are
using.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Not representable result out of too large range
Next
From: Peter Eisentraut
Date:
Subject: Re: Possible solution for LIKE optimization