mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-7947 strcmp() takes 0.37% in OLTP RO
This patch ensures that all identical character sets shares the same cs->csname. This allows us to replace strcmp() in my_charset_same() with comparisons of pointers. This fixes a long standing performance issue that could cause as strcmp() for every item sent trough the protocol class to the end user. One consequence of this patch is that we don't allow one to add a character definition in the Index.xml file that changes the csname of an existing character set. This is by design as changing character set names of existing ones is extremely dangerous, especially as some storage engines just records character set numbers. As we now have a hash over character set's csname, we can in the future use that for faster access to a specific character set. This could be done by changing the hash to non unique and use the hash to find the next character set with same csname.
This commit is contained in:
@ -362,7 +362,14 @@
|
||||
<alias>iso_8859-1:1987</alias>
|
||||
<alias>l1</alias>
|
||||
<alias>latin1</alias>
|
||||
<collation name="latin1_test" id="99" order="test"/>
|
||||
<!--
|
||||
The server rejects binding an existing built-in collation
|
||||
to a different character set through Index.xml.
|
||||
This example tries to override cp1250_polish_ci with id 99
|
||||
and bind it to latin1:
|
||||
-->
|
||||
<collation name="latin1_test_replace" id="99"/>
|
||||
<collation name="latin1_test" id="331" order="test"/>
|
||||
<collation name="latin1_test2" id="332" order="test"/>
|
||||
<collation name="latin1_test2_cs" id="333"/>
|
||||
<collation name="latin1_swedish_nopad2_ci" id="334" flag="nopad">
|
||||
|
Reference in New Issue
Block a user