在5.1.46中优化器在对primary key的选择上做了一点改动:
Performance: While looking for the shortest index for a covering index scan, the optimizer did not consider the full row length for a clustered primary key, as in InnoDB. Secondary covering indexes will now be preferred, making full table scans less likely。
该版本中增加了find_shortest_key函数,该函数的作用可以认为是选择最小key length的
索引来满足我们的查询。
该函数是怎么工作的:
and is clustered, like in MyISAM, then the behavior today should remain the same. If the
primary key is clustered, like in InnoDB, then it should not consider using the primary
key because then the storage engine will have to scan through much more data.
本文地址:https://www.stayed.cn/item/5147
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我