問題1:55-60和900-905都是加了5為什么掃描rows不一樣一個是5一個6!?。?/h1>
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://idcbgp.cn/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??
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://idcbgp.cn/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??