Re: UTF8MatchText - Mailing list pgsql-patches

From ITAGAKI Takahiro
Subject Re: UTF8MatchText
Date
Msg-id 20070409111732.8786.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Whole thread Raw
In response to Re: UTF8MatchText  (Bruce Momjian <bruce@momjian.us>)
Responses Re: UTF8MatchText
Re: UTF8MatchText
List pgsql-patches
Bruce Momjian <bruce@momjian.us> wrote:

> > I do not understand this patch.  You have defined two functions,
> > UTF8MatchText() and UTF8MatchTextIC(), and the difference between them
> > is that one calls CHAREQ and the other calls ICHAREQ, but just above
> > those two functions you define the macros identically:
>
> Why are there two functions?  Also, can't you use one function and just
> pass a boolean to indicate whether case should be ignored?

The same is true of MBMatchText() and MBMatchTextIC().
Now, I'll split the patch into two changes.

1. DropMBMatchTextIC.patch
        Drop MBMatchTextIC() and use MBMatchText() instead.

2. UTF8MatchText.patch
        Add UTF8MatchText() as a specialized version of MBMatchText().


As a future work, it might be good to research the performance of rewriting
"col ILIKE 'pattern'" to "lower(col) LIKE lower('pattern')" in planner so that
we can avoid to call lower() for constant pattern in the right-hand side and
can use functional indexes (lower(col)). I think we never need MBMatchTextIC()
in the future unless we move to wide-character server encoding :)

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [DOCS] Fix misleading references to columns in GRANT/REVOKE summaries
Next
From: Bruce Momjian
Date:
Subject: Re: [DOCS] Fix misleading references to columns in GRANT/REVOKE summaries