Обсуждение: Performance problems with Thai language

Поиск
Список
Период
Сортировка

Performance problems with Thai language

От
Andrey Zhidenkov
Дата:
We have faced in issue in our Postgresql 9.5.13 cluster. Inserts into
btree index are too slow when strings contain Thai characters.Test
script and results are in the attachment. Test shows that insert Thai
string into index is more than 60x times slower than Chinese or
Russian, for example. Tracing with perf showed that problem is in
strcoll_l() libc function (see thai-slow.svg). This function is used
when locale is different from 'C'. For 'C' locale just simple
comparison is used (see thai-fast.graph) and performance is OK.
Of course, I googled and thought that it is a bug in glibc
(https://sourceware.org/bugzilla/show_bug.cgi?id=18441), but when I
tried previous version of glibc (2.19 and 2.13) I found out that it
still reproduced. I know that I can upgrade PostgreSQL to 10 and user
libicu for string comparison but is there any way to fix that in
PostgreSQL 9.5.13?

P.S. I can provide COLLATE "C" for this column during its creation but
it looks a little bit tricky.

-- 
With best regards, Andrey Zhidenkov

Вложения