Re: UTF8MatchText

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: UTF8MatchText
Date: 2007-04-09 02:48:44
Message-ID: 20070409111732.8786.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian <bruce(at)momjian(dot)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 Content-Type Size
DropMBMatchTextIC.patch application/octet-stream 17.1 KB
UTF8MatchText.patch application/octet-stream 3.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-04-09 06:21:57 Re: Reviewers Guide to DeferredTransactions/TransactionGuarantee
Previous Message Tom Lane 2007-04-09 02:24:23 Re: [HACKERS] Arrays of Complex Types

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-04-09 02:52:30 Re: [PATCHES] Fix misleading references to columns in GRANT/REVOKE summaries
Previous Message Tom Lane 2007-04-09 02:28:23 Re: [PATCHES] Fix misleading references to columns in GRANT/REVOKE summaries