Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] like/ilike improvements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] like/ilike improvements
Date: 2007-06-01 11:16:16
Message-ID: 46600000.70401@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches

ITAGAKI Takahiro wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Matthew T. O'ConnorDate: 2007-06-01 13:03:51
Subject: Re: Autovacuum versus rolled-back transactions
Previous:From: Simon RiggsDate: 2007-06-01 11:02:34
Subject: Re: Attempt to re-archive existing WAL logs afterrestoring from backup

pgsql-patches by date

Next:From: Andrew DunstanDate: 2007-06-01 14:17:16
Subject: Re: Concurrent psql patch
Previous:From: ITAGAKI TakahiroDate: 2007-06-01 05:07:29
Subject: Re: [HACKERS] like/ilike improvements

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group