建表语句:
查询语句1:SELECT * FROM hz_user
ORDER BY telephone LIMIT 10000,10;
查询语句2: SELECT id FROM hz_user
ORDER BY telephone LIMIT 10000,10;
执行计划1:EXPLAIN SELECT * FROM hz_user
ORDER BY telephone LIMIT 10000,10;
执行计划2:EXPLAIN SELECT id FROM hz_user
ORDER BY telephone LIMIT 10000,10;
1. 为什么两个语句几乎一样的,查出来的结果不一样?
2.为什么第1个语句要全表扫描,而不走索引?是因为telephone字段有null值吗?