如果发现sql语句始终走另一个索引,但是希望它走想要的索引,怎么办

用 force index()指定想要走的索引 一、使用explain工具分析sql explain select count(id) from person_info_large;二、修改sql或者尽量让sql走索引 explain

用 force index()指定想要走的索引

一、使用explain工具分析sql

explain select count(id) from person_info_large;


二、修改sql或者尽量让sql走索引

explain select count(id) from person_info_large force index (primary);

发布者:admin,转转请注明出处:http://www.yc00.com/web/1743863614a4520165.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信