While reducing testcase found that server is taking too much time on Closing tables/opening tables states.
mysql> SHOW FULL PROCESSLIST;
+----+------+-----------+------+---------+------+----------------+-----------------------+-----------+---------------+
| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined |
+----+------+-----------+------+---------+------+----------------+-----------------------+-----------+---------------+
| 5 | root | localhost | test | Query | 532 | closing tables | DROP VIEW IF EXISTS d | 0 | 0 |
| 8 | root | localhost | test | Query | 0 | init | SHOW FULL PROCESSLIST | 0 | 0 |
+----+------+-----------+------+---------+------+----------------+-----------------------+-----------+---------------+
2 rows in set (0.00 sec)
mysql>
mysql> SHOW FULL PROCESSLIST;
+----+------+-----------+------+---------+------+----------------+-------------------------------------------------------------------------+-----------+---------------+
| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined |
+----+------+-----------+------+---------+------+----------------+-------------------------------------------------------------------------+-----------+---------------+
| 5 | root | localhost | test | Query | 1119 | Opening tables | REPLACE INTO `table500_tokudb_default_int` ( `c7` ) VALUES
( 6792960 ) | 0 | 0 |
| 8 | root | localhost | test | Query | 0 | init | SHOW FULL PROCESSLIST | 0 | 0 |
+----+------+-----------+------+---------+------+----------------+-------------------------------------------------------------------------+-----------+---------------+
2 rows in set (0.00 sec)
While reducing testcase found that server is taking too much time on Closing tables/opening tables states.
mysql> SHOW FULL PROCESSLIST; -----+- ------- ---+--- ---+--- ------+ ------+ ------- ------- --+---- ------- ------- -----+- ------- ---+--- ------- -----+ -----+- ------- ---+--- ---+--- ------+ ------+ ------- ------- --+---- ------- ------- -----+- ------- ---+--- ------- -----+ -----+- ------- ---+--- ---+--- ------+ ------+ ------- ------- --+---- ------- ------- -----+- ------- ---+--- ------- -----+
+----+-
| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined |
+----+-
| 5 | root | localhost | test | Query | 532 | closing tables | DROP VIEW IF EXISTS d | 0 | 0 |
| 8 | root | localhost | test | Query | 0 | init | SHOW FULL PROCESSLIST | 0 | 0 |
+----+-
2 rows in set (0.00 sec)
mysql>
mysql> SHOW FULL PROCESSLIST; -----+- ------- ---+--- ---+--- ------+ ------+ ------- ------- --+---- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ ------- ----+-- ------- ------+ -----+- ------- ---+--- ---+--- ------+ ------+ ------- ------- --+---- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ ------- ----+-- ------- ------+ tokudb_ default_ int` ( `c7` ) VALUES -----+- ------- ---+--- ---+--- ------+ ------+ ------- ------- --+---- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ ------- ----+-- ------- ------+
+----+-
| Id | User | Host | db | Command | Time | State | Info | Rows_sent | Rows_examined |
+----+-
| 5 | root | localhost | test | Query | 1119 | Opening tables | REPLACE INTO `table500_
( 6792960 ) | 0 | 0 |
| 8 | root | localhost | test | Query | 0 | init | SHOW FULL PROCESSLIST | 0 | 0 |
+----+-
2 rows in set (0.00 sec)
mysql>