Answer the question
In order to leave comments, you need to log in
Why is sometimes a simple MySQL query running slowly?
There is a table (about 40 million rows):
CREATE TABLE `related_articles` (
`articleID` int(32) DEFAULT NULL,
`relatedArticleID` int(32) DEFAULT NULL,
KEY `IX_ArticleID` (`articleID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
SELECT relatedArticleID FROM related_articles WHERE articleID = 252381;
+----+-------------+------------------+------+---------------+--------------+---------+-------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------------+------+---------------+--------------+---------+-------+------+-------------+
| 1 | SIMPLE | related_articles | ref | IX_ArticleID | IX_ArticleID | 5 | const | 10 | Using where |
+----+-------------+------------------+------+---------------+--------------+---------+-------+------+-------------+
+------------------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+------------------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| related_articles | 1 | IX_ArticleID | 1 | articleID | A | 10252773 | NULL | NULL | YES | BTREE | | |
+------------------+------------+--------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question