用 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);
一、使用explain工具分析sql
explain select count(id) from person_info_large;
二、修改sql或者尽量让sql走索引
explain select count(id) from person_info_large force index (primary);