广州飞狐科技有限公司官网
技术文章
2020-12-27 17:35:27

sql语句指定想要运行的索引

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

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

一、使用explain工具分析sql

explain%20select%20count(id)%20from%20person_info_large;

二、修改sql或者尽量让sql走索引 explain select count(id) from person_info_large force index (primary);


原文链接:https://blog.csdn.net/loulanyue_/article/details/104139853

上一篇:JavaScript中的this/call/apply/bind
下一篇:jQuery实现拖拽,不用jQuery UI的中文编程实现方法(亲测好用)