mysql---連合インデックスが有効かどうか

2472 ワード

create table test(
id1 int ,
id2 int,
id3 int,
id4 int,
key index_id12(id1,id2)
);

    
explain select * from test where id1 < 10;
    
explain select * from test where id1 < 10 and id2 > 1; 
    
explain select * from test where id2 > 1 and id1 < 2; 
     
explain select * from test where id2 > 1;
     
explain select * from test order by id1 desc ;
    
explain select id1 from test order by id1 desc ;
explain select id1,id2 from test order by id1 desc ;
     
explain select id1,id2,id3 from test order by id1 desc ;