您的当前位置:首页 >系统运维 >老司机也该掌握的MySQL优化指南 正文

老司机也该掌握的MySQL优化指南

时间:2025-11-05 15:50:38 来源:网络整理编辑:系统运维

核心提示

复制mysql>explainpartitionsselectcount(1)fromuser_partitionwhereidin(1,2,3,4,5); +----+-

老司机也该掌握的MySQL优化指南
复制mysql> explain partitions select count(1) from user_partition where id in (1,老司2,3,4,5);  +----+-------------+----------------+------------+-------+---------------+---------+---------+------+------+--------------------------+  | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | Extra |  | 1 | SIMPLE | user_partition | p1,p4 | range | PRIMARY | PRIMARY | 8 | | 5 | Using where; Using index |  1 row in set (0.00 sec)  1.2.3.4.5.