主键中的列顺序是否会根据 select 语句中给出的列顺序影响相关查询的性能?
例子:
primary key (col1, col2, col3);
select col2, col3 from table;
-> 这个选择会使用 pk 索引吗?
select col3,col1,col2 from table;
-> 这个选择会使用 pk 索引吗?
主键中的列顺序是否会根据 select 语句中给出的列顺序影响相关查询的性能?
例子:
primary key (col1, col2, col3);
select col2, col3 from table;
-> 这个选择会使用 pk 索引吗?
select col3,col1,col2 from table;
-> 这个选择会使用 pk 索引吗?