MySQL Forums
Forum List  »  PHP

Mysql 5.7.20 Innodb Delete query very slow randomly on CentOS 7.x
Posted by: Stanislav Hloch
Date: December 07, 2017 06:37AM

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?

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;

DELETE FROM list_ip WHERE address='' AND type='INT' AND datetime<='2017-12-06 08:04:30';

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.

Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.