索引 - Mysql Limit查询优化问题
ringa_lee
ringa_lee 2017-04-17 11:36:28
0
1
728

1.《高性能MYSQL》上的,没看懂这是什么优化,film_id应该是主键吧,求解释

2.顺便再问一个问题,这个sql说明使用索引,不过file_name并不是索引列,具体执行的时候是怎么执行,扫描索引列再匹配file_name,看着是这样子吧,这个sql能改写下达到相同的想过吗

ringa_lee
ringa_lee

ringa_lee

reply all(1)
PHPzhong
  1. This rewriting is mainly based on the structural characteristics of the index. The original statement may cause cross-page when the field is long, and the limit statement itself is very inefficient. In the rewritten query, index coverage can be achieved by querying film_id alone.

  2. I don’t understand what you mean.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!