Re: [HACKERS] like/ilike improvements - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: [HACKERS] like/ilike improvements
Date
Msg-id 46600000.70401@dunslane.net
Whole thread Raw
In response to Re: [HACKERS] like/ilike improvements  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: [HACKERS] like/ilike improvements
List pgsql-patches

ITAGAKI Takahiro wrote:
> Andrew Dunstan <andrew@dunslane.net> wrote:
>
>
>> OK, here is a patch that I think incorporates all the ideas discussed
>> (including part of Mark Mielke's suggestion about optimising %_). There
>> is now no special treatment of UTF8 other than its use of a faster
>> NextChar macro.
>>
>
> This is a benchmark result of 1000 loops of
>   SELECT count(*) INTO cnt FROM item WHERE i_title LIKE '%BABABABABARIBA%'
> on the table with 10000 rows.
>
>          | SQL_ASCII | LATIN1 |  UTF8 | EUC_JP
> ---------+-----------+--------+-------+---------
>  HEAD    |      8017 |   8029 | 16928 |  18213
>  Patched |      7899 |   7887 |  9985 |  10370 [ms]
>
> It improved the performance not only for UTF8, but also for other
> multi-byte encodings and a bit for single-byte encodings.
>
>
>

Interesting. I infer from these results that the biggest bang here comes
from abandoning CHAREQ and doing all comparisons byte-wise.

cheers

andrew

pgsql-patches by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: [HACKERS] like/ilike improvements
Next
From: Andrew Dunstan
Date:
Subject: Re: Concurrent psql patch