mariadb/mysql-test/suite
Annamalai Gurusami b5299f3559 Bug #18806829 OPENING INNODB TABLES WITH MANY FOREIGN KEY REFERENCES IS
SLOW/CRASHES SEMAPHORE

Problem:

There are 2 lakh tables - fk_000001, fk_000002 ... fk_200000.  All of them
are related to the same parent_table through a foreign key constraint.
When the parent_table is loaded into the dictionary cache, all the child table
will also be loaded.  This is taking lot of time.  Since this operation happens
when the dictionary latch is taken, the scenario leads to "long semaphore wait"
situation and the server gets killed.

Analysis:

A simple performance analysis showed that the slowness is because of the
dict_foreign_find() function.  It does a linear search on two linked list
table->foreign_list and table->referenced_list, looking for a particular
foreign key object based on foreign->id as the key.  This is called two
times for each foreign key object.

Solution:

Introduce a rb tree in table->foreign_rbt and table->referenced_rbt, which
are some sort of index on table->foreign_list and table->referenced_list
respectively, using foreign->id as the key.  These rbt structures will be
solely used by dict_foreign_find().  

rb#5599 approved by Vasil
2014-06-10 09:35:50 +05:30
..
binlog Bug#17942050:KILL OF TRUNCATE TABLE WILL LEAD TO BINARY LOG 2014-04-15 15:17:25 +05:30
engines Bug#16274455: CAN NOT ACESS PARTITIONED TABLES WHEN 2013-02-14 17:03:49 +01:00
federated Bug #12876932 - INCORRECT SELECT RESULT ON FEDERATED TABLE 2012-07-26 15:29:19 +05:30
funcs_1 local merge. 2013-03-22 20:16:53 +05:30
funcs_2 Changed to Oracle bug numbers 2011-05-24 12:08:13 +05:30
innodb Bug #18806829 OPENING INNODB TABLES WITH MANY FOREIGN KEY REFERENCES IS 2014-06-10 09:35:50 +05:30
innodb_zip BUG#16321920 : CREATE A SEPARATE INNODB_ZIP TEST SUITE 2013-11-29 15:13:47 +05:30
jp WL#2360 Performance schema 2010-01-11 18:47:27 -07:00
large_tests BUG#11877618: rpl_slave_net_timeout fails in rpl_sync.inc (at sync_slave_with_master) 2011-03-17 11:31:42 +01:00
manual BUG#49978: Replication tests don't clean up replication state at the end 2010-12-19 18:07:28 +01:00
parts Bug#16274455: CAN NOT ACESS PARTITIONED TABLES WHEN 2013-02-14 17:03:49 +01:00
perfschema Bug#16060864 SEGMENTATION FAULT IN PERFORMANCE_SCHEMA WITH HISTORY SIZE 0 2013-01-02 11:00:55 +01:00
perfschema_stress Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
rpl Bug#17283409 4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS, 2014-05-08 18:13:01 +05:30
stress Bug #11751927 42960: MTR2: NO MORE --STRESS PARAMETERS 2011-09-15 12:34:32 +02:00
sys_vars Bug#17075846 - UNQUOTED FILE NAMES FOR VARIABLE VALUES ARE 2014-02-12 14:33:56 +05:30