对于这样单柱或复合指数
[ col1 - col2 - col3 - col4 ]
[ 1 - 2 - 3 - 4 ]
我将使用两种类型的查询在两种情况下
一个表是SELECT * FROM table WHERE col1 = 1 AND col2 = 2 AND col3 = 3;
另一个是SELECT * FROM table WHERE col1 = 1 AND col2 = 2 AND col4 = 4;
在这种情况下,我可以制作一个
composite index
只col1 AND col2
和col3 AND col4
一个single-column index
还是我去
ALL
列single-column index
或把
ALL
列在composite index
边问:我有命名索引?什么是索引大小?
@a_horse_with_no_name mysql –