Bug #88824 Mysql 5.7.20 Innodb Delete query very slow randomly on CentOS 7.x
Submitted: 7 Dec 2017 19:46 Modified: 8 Dec 2017 1:10
Reporter: Stan Z. Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.7.20 OS:CentOS (7.x)
Assigned to: CPU Architecture:Any

[7 Dec 2017 19:46] Stan Z.
Description:
I have table with 5 simple fields. Total rows in table is cca 250. 
When I use PHPmyAdmin with one DELETE query it is processed in 0.05 sec. (always). 
Problem is that my PHP application (PDO connection) processing same query between other queries and this query is extremely slow (approx 10 sec.). It happened only sometimes! Other queries (approx 50) are always OK with normal time response. 
What problem should be or how to find what is the problem? 

I tested also with empty table and its slow too. How to deep analyze why it is soo slow? 
By me its something with Mysql server, communication or similar problem but I dont know how to deep analyze.
I tried all possible queries for analyze, repair, etc, but everything looks OK.

How to repeat:
Table: 
CREATE TABLE list_ip ( id INT(11) NOT NULL AUTO_INCREMENT, type CHAR(20) NOT NULL DEFAULT '', address CHAR(50) NOT NULL DEFAULT '', description VARCHAR(50) NOT NULL DEFAULT '', datetime DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00', PRIMARY KEY (id), INDEX address (address), INDEX type (type), INDEX type (datetime) ) COLLATE='utf8_general_ci' ENGINE=InnoDB; 

Query: 
DELETE FROM list_ip WHERE address='1.2.3.4' AND type='INT' AND datetime<='2017-12-06 08:04:30';
[7 Dec 2017 22:23] Stan Z.
I also tried logging by:
slow_query_log = 1
slow_query_log_file = /var/log/mysql/mysql-slow.log
long_query_time = 5

but file is not generated when query is 10s long.
[8 Dec 2017 1:10] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.