explain 分析 聚合统计语句的性能

EXPLAIN SELECT COUNT(1) FROM question;

id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE question index uid 4 18559829 100 Using index

EXPLAIN SELECT COUNT(*) FROM question;


id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE question index uid 4 18542063 100 Using index
;

EXPLAIN SELECT COUNT(*) AS "aggregation" FROM question;

id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE question index uid 4 18588130 100 Using index

原文地址:https://www.cnblogs.com/rsapaper/p/10144120.html