有两个表所有的查询速度都很快,只有cid=5的情况下速度会很慢,重建索引也没见效果;
这是什么问题导致的。存在着歌问题貌似有段时间了,count了下数量,cid=5的条数最少,查询时间最耗时;
mysql> SELECT `uuid` FROM `ey_article` WHERE `cid` = 4 ORDER BY kid DESC LIMIT 0,1;
+----------------------------------+
| uuid |
+----------------------------------+
| 62ff694813f3c564484d864d977bfd50 |
+----------------------------------+
1 row in set (0.01 sec)
mysql> SELECT `uuid` FROM `ey_article` WHERE `cid` = 1 ORDER BY kid DESC LIMIT 0,1;
+----------------------------------+
| uuid |
+----------------------------------+
| 1246f583e18537d10fbd6c65dd258396 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> SELECT `uuid` FROM `ey_article` WHERE `cid` = 2 ORDER BY kid DESC LIMIT 0,1;
+----------------------------------+
| uuid |
+----------------------------------+
| d73421575ca1af800df8dedf200d8da4 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> SELECT `uuid` FROM `ey_article` WHERE `cid` = 5 ORDER BY kid DESC LIMIT 0,1;
+----------------------------------+
| uuid |
+----------------------------------+
| b32d55762b848758c885b7a5c1a027cf |
+----------------------------------+
1 row in set (2.61 sec)
你的问题解决了吗?,我也遇到相似的问题了