不同查询方式
sql
explain select * from city;
#主键查询
explain select * from city where ID=5;
#索引查询
explain select * from city where CountryCode='NLD';
#主键范围查询
explain select * from city where ID>5 and ID<20;
#非索引范围查询
explain select * from city where Population>193238 and Population<200000;
查询结果
![](https://file.jishuzhan.net/article/1793975005646688257/813b3482ecacf12f864476b6c3972219.webp)
![](https://file.jishuzhan.net/article/1793975005646688257/db5ebe7a2886cbd0d72ec699f97a7532.webp)
![](https://file.jishuzhan.net/article/1793975005646688257/faef0cce70118957a630f201589dbeb2.webp)
![](https://file.jishuzhan.net/article/1793975005646688257/3e8b260528385dea663e61119aeaa81b.webp)
![](https://file.jishuzhan.net/article/1793975005646688257/4382964406c1f8d63b73a67a8853716c.webp)