mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 15:45:33 +02: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:
parent
46ffd47f42
commit
dbcd3384e0
30 changed files with 386 additions and 245 deletions
|
|
@ -23,6 +23,8 @@
|
|||
#include "strings_def.h"
|
||||
#include <m_ctype.h>
|
||||
|
||||
const char charset_name_binary[]= "binary";
|
||||
|
||||
static const uchar ctype_bin[]=
|
||||
{
|
||||
0,
|
||||
|
|
@ -568,7 +570,7 @@ struct charset_info_st my_charset_bin =
|
|||
{
|
||||
63,0,0, /* number */
|
||||
MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_PRIMARY|MY_CS_NOPAD,/* state */
|
||||
"binary", /* cs name */
|
||||
charset_name_binary, /* cs name */
|
||||
"binary", /* name */
|
||||
"", /* comment */
|
||||
NULL, /* tailoring */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue