问题1:55-60和900-905都是加了5为什么扫描rows不一样一个是5一个6!!!
explain SELECT film_id ,description FROM sakila.film WHERE film_id>55 and film_id<=60 ORDER BY film_id LIMIT 1,5
1 SIMPLE film range PRIMARY,idx_filmid PRIMARY 2 5 Using where
EXPLAIN SELECT film_id ,description FROM sakila.film WHERE film_id>900 and film_id<=905 ORDER BY film_id LIMIT 1,5
1 SIMPLE film range PRIMARY,idx_filmid PRIMARY 2 6 Using where
问题1:55-60和900-905都是加了5为什么扫描rows不一样一个是5一个6!!!?????
http://www.imooc.com/wenda/detail/id/237619?page=2
再就是film_id是主键但是:
[SQL]SELECT film_id ,description FROM sakila.film ORDER BY film_id LIMIT 50,5
受影响的行: 0
时间: 0.001s
1 SIMPLE film ALL 1000 Using filesort
扫描Rows 是1000,用到了filesort??