1、创建表
2、插入数据
3、创建索引
4、我们开始执行下面的SQLselect * from sunyang_test where b=5000;
5、select * from sunyang_test where c=5000;
6、select * from sunyang_test where a=1 and b=5000;
7、select * from sunyang_test where a=1 and c=5000;
8、select * from sunyang_test where b=5000 and c=5000;
9、select * from sunyang_test where a=1 and b=5000 and c=5000;
10、可以看到,在a列区分度不大,且需要a、b、c单列查询或组合查询时,这样建索引将所有查询情况都覆盖到了,并且索引不复杂。