Hi hackers,
I tried to improve performance when database is Chinese.
Under openSUSE, create index on table with 54996 rows
locale=C, 140ms
locale=zh_CN, 985ms
I think the function strcoll() of Linux is too slow.
So, I made a new utf8 to GB18030 map, store Chinese order in it.
Do not call strcoll().
On my modified code, same operation, locale=zh_CN, 203ms.
My English is too bad to describe my idea.
Please find the attachment.
The users in China would like to use locale=C, because it is faster.
When need to order, they call function convert() to do.
And I found some wrong order in the locale zh_CN of Linux.
In my test under Windows, there is performance improve too.
Windows XP sp3, vm, locale=Chinese_People's Republic of China.936
original code, 343ms
modified code, 235ms
Maybe, some Asian Languages have same problem.
Regards,
Quan Zongliang