Re: Allow multi-byte characters as escape in SIMILAR TO and SUBSTRING

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Allow multi-byte characters as escape in SIMILAR TO and SUBSTRING
Дата
Msg-id 9045.1405093870@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Allow multi-byte characters as escape in SIMILAR TO and SUBSTRING  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Allow multi-byte characters as escape in SIMILAR TO and SUBSTRING  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> Attached is a small patch to $SUBJECT.
> In master, only single-byte characters are allowed as an escape. Of
> course, with the patch it must still be a single character, but it may
> be multi-byte.

I'm concerned about the performance cost of this patch.  Have you done
any measurements about what kind of overhead you are putting on the
inner loop of similar_escape?

At the very least, please don't call GetDatabaseEncoding() over again
every single time through the inner loop.  More generally, why do we
need to use pg_encoding_verifymb?  The input data is presumably validly
encoded.  ISTM the significantly cheaper pg_mblen() would be more
appropriate.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Allow multi-byte characters as escape in SIMILAR TO and SUBSTRING
Следующее
От: Michael Banck
Дата:
Сообщение: Re: Is there a way to temporarily disable a index