标签:nload 联合 from and 匹配 explain http sql span
mysql 演示数据库:http://downloads.mysql.com/docs/sakila-db.zip
explain select * from rental where rental_date=‘2005-05-25 17:22:10‘ and inventory_id=373 and customer_id=343
explain select * from rental where customer_id >= 373 and customer_id<400
仅仅使用索引中的最左列进行查询,比如:在col1+col2+col3字段上的联合索引中,能够使用的索引情况可以有:col1 (col2+col3) ,col1+col2+col3。不能被使用的索引:col2 (col2+col3) 等情况。以payment表为例
alter table payment add index idx_payment_date (payment_date,amount,last_update);
explain select * from payment where payment_date=‘2006-02-14 15:16:03‘ and last_update=‘2006-02-15 22:12:32‘\G;
explain select * from payment where amount=3.98 and last_update=‘2006-02-15 22:12:32‘\G;
标签:nload 联合 from and 匹配 explain http sql span
原文地址:http://www.cnblogs.com/dsitn/p/7088921.html