Description:
I've observed that create table operations in 5.1.24 are slower than in 5.0.58 and 5.1.23 for more than 10%:
------------------------------------------+--------+----------------+
| 5.1.23 | 5.1.24 |
---------------------------------+--------+--------+-------+--------+
Test name | Count | Time | Ratio | Time |
---------------------------------+--------+--------+-------+--------+
create_MANY_tables | 10000| 8.67| 1.15| 10.01|
create_key+drop | 10000| 9.17| 1.16| 10.65|
create+drop | 10000| 8.48| 1.18| 10.02|
I created small test case that create in loop 10000 tables:
Creating in loop 10000 tables
Server version | 5.0.58 | 5.1.23 | 5.1.24
----------------------------------------------------
Time | 8.41sec | 8.39sec | 9.4sec
Oprofile output for 5.0.58, 5.1.23, 5.1.24 looks pretty similar with exeception that we spent a bit more time in parser for 5.1.24:
5.1.24
Profiling through timer interrupt
samples % symbol name
15.1079 MYSQLparse(void*)
7.9137 MYSQLlex(void*, void*)
4.3165 mi_create
4.3165 my_hash_sort_bin
2.8777 mysql_prepare_create_table(THD*, st_ha_create_information*,
Alter_info*, bool, unsigned int*, handler*, st_key**, unsigned int*, int)
2.8777 open_binary_frm(THD*, st_table_share*, unsigned char*, int)
2.1583 build_table_filename(char*, unsigned long, char const*, char const*, char const*, unsigned int)
2.1583 fn_format
2.1583 get_hash_symbol(char const*, unsigned int, bool)
2.1583 my_pthread_fastmutex_lock
2.1583 my_utf8_uni
1.4388 alloc_root
5.1.22
samples % symbol name
12.7660 MYSQLparse(void*)
4.2553 MYSQLlex(void*, void*)
4.2553 my_hash_sort_bin
3.5461 alloc_root
3.5461 get_hash_symbol(char const*, unsigned int, bool)
3.5461 open_binary_frm(THD*, st_table_share*, unsigned char*, int)
2.8369 my_write
2.8369 mysql_create_frm(THD*, char const*, char const*, char
const*, st_ha_create_information*, List<Create_field>&, unsigned int, st_key*, handler*)
2.1277 fn_format
2.1277 make_empty_rec(THD*, int, legacy_db_type, unsigned int,
List<Create_field>&, unsigned int, unsigned long, handler*)
2.1277 mysql_prepare_create_table(THD*, st_ha_create_information*,
Alter_info*, bool, unsigned int*, handler*, st_key**, unsigned int*, int)
2.1277 strconvert(charset_info_st*, char const*, charset_info_st*, char*, unsigned int, unsigned int*)
5.0.58
samples % symbol name
13.1148 MYSQLparse(void*)
5.7377 my_hash_sort_bin
4.0984 openfrm(THD*, char const*, char const*, unsigned int, unsigned int, unsigned int, st_table*)
2.4590 .plt
2.4590 MYSQLlex(void*, void*)
2.4590 cleanup_dirname
2.4590 fn_format
2.4590 get_hash_symbol(char const*, unsigned int, bool)
2.4590 my_write
2.4590 mysql_execute_command(THD*)
2.4590 mysql_prepare_table(THD*, st_ha_create_information*,
Alter_info*, bool, unsigned int*, handler*, st_key**, unsigned int*, int)
2.4590 strmake
How to repeat:
Start 5.0.58, 5.1.23, 5.1.24 with defaults as following:
./bin/mysqld --no-defaults --datadir=<your datadir> --basedir=.
run attached perl script - just customize db_host, db_socket, db_name and max number of tables to create: