Re: UTF8MatchText

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: UTF8MatchText
Date: 2007-05-18 03:31:22
Message-ID: 18822.1179459082@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Attached is my current WIP patch.

A few quick eyeball comments:

> ! static __inline__ int

Under *no* circumstances use __inline__, as it will certainly break
every non-gcc compiler. Use "inline", which we #define appropriately
at need.

> ! * UTF8 has disjoint representations for first-bytes and
> ! * not-first-bytes of MB characters, and thus it is
> ! * impossible to make a false match in which an MB pattern
> ! * character is matched to the end of one data character
> ! * plus the start of another.
> ! * In character sets without that property, we have to use the
> ! * slow way to ensure we don't make out-of-sync matches.

I thought we'd concluded that this explanation is pseudo-science?

> ! * Branch for non-utf8 multi-byte charsets and also for single-byte
> ! * charsets which don't gain any benefir from the above optimisation.

spellcheck...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-05-18 03:42:45 Re: UTF8MatchText
Previous Message Andrew Dunstan 2007-05-18 03:06:05 Re: UTF8MatchText

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2007-05-18 03:42:45 Re: UTF8MatchText
Previous Message Andrew Dunstan 2007-05-18 03:06:05 Re: UTF8MatchText