Degraded performance due to FKs
Bug #1323765 reported by
Seppo Jaakola
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL patches by Codership |
Confirmed
|
Undecided
|
Unassigned | |||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Confirmed
|
Medium
|
Unassigned | |||
5.6 |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Foreign key processing is suspected to cause performance bottleneck.
One test manifesting this is to load employee database from: https:/
Here are test results with Galera Cluster 5.6.17 development head version, compared to native MySQL 5.6.17:
mysql -uroot < employees.sql
2 node Cluster mysql 5.6.17
FK ON: 1m32.696s 0m36.379s
FK OFF: 1m1.442s 0m35.025s
=> FK overhead in cluster is roughly 50%
description: | updated |
description: | updated |
description: | updated |
To post a comment you must log in.
Guys here is the oprofile output. connections_ sockets Just jumps up, as well as THD::THD(bool, bool) so main thread object creation when WSREP is active.
What I was noticing is that when using the FK the calls to handle_
let me know if I can help more.
Without FK oprofile_ data/samples/ for samples directory. 0-0xb77d5fff)
--------------
Using /tmp/oprofile/
CPU: Core 2, speed 2.2e+06 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
CPU_CLK_UNHALT...|
samples| %|
------------------
3251 100.000 mysqld
CPU_CLK_UNHALT...|
samples| %|
------------------
1185 36.4503 libc-2.17.so
1066 32.7899 no-vmlinux
907 27.8991 mysqld
70 2.1532 libpthread-2.17.so
8 0.2461 libstdc++.so.6.0.17
6 0.1846 libgalera_smm.so
5 0.1538 [vdso] (tgid:4884 range:0xb77d500
3 0.0923 libcrypto.so.1.0.0
1 0.0308 libgcc_s.so.1
With FK l01:/tmp/ oprofile# opreport oprofile_ data/samples/ for samples directory. 0-0xb77d5fff)
--------------
root@tusacentra
Using /tmp/oprofile/
CPU: Core 2, speed 2.2e+06 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
CPU_CLK_UNHALT...|
samples| %|
------------------
7239 100.000 mysqld
CPU_CLK_UNHALT...|
samples| %|
------------------
2811 38.8313 no-vmlinux
2779 38.3893 mysqld
1164 16.0796 libc-2.17.so
340 4.6968 libpthread-2.17.so
88 1.2156 [vdso] (tgid:4884 range:0xb77d500
57 0.7874 libstdc++.so.6.0.17
Without FK l01:/tmp/ oprofile# opreport -l -p /lib/modules/`uname -r` oprofile_ data/samples/ for samples directory. 0-0xb77d5fff) could not be found. linux-gnu/ libc-2. 17.so array(THD* , char const*, st_mysql_show_var*, enum_var_type, system_status_var*, char const*, TABLE*, bool, Item*) chunkset formed_ len_mb mutex_trylock get_pc_ thunk.bx ::store( char const*, unsigned int, charset_info_st const*) connections_ sockets( )
--------------
root@tusacentra
Using /tmp/oprofile/
warning: /no-vmlinux could not be found.
warning: [vdso] (tgid:4884 range:0xb77d500
CPU: Core 2, speed 2.2e+06 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
samples % image name symbol name
1185 36.5290 libc-2.17.so /lib/i386-
1066 32.8607 no-vmlinux /no-vmlinux
50 1.5413 mysqld show_status_
44 1.3564 mysqld my_utf8_uni
42 1.2947 mysqld THD::THD(bool, bool)
36 1.1097 mysqld heap_scan
34 1.0481 mysqld hp_allocate_
28 0.8631 mysqld my_qsort
27 0.8323 mysqld my_well_
25 0.7707 libpthread-2.17.so pthread_
22 0.6782 mysqld __i686.
19 0.5857 mysqld strnmov
18 0.5549 mysqld Field_varstring
18 0.5549 mysqld handle_
16 ...