posted in MySQL 

组合索引的列顺序如何排列
select count(*) from t1,t2 where t1.id=t2.id and t1.owner='SCOTT';
这种sql,t2上建立(id)索引,t1上建立组合索引(owner,id)
尽量把join列放到组合索引最后面
INDEX FAST FULL SCAN inx_id_owner select count(*) from t1,t2 where t1.id=t2.id and t1.owner='SCOTT';
INDEX RANGE SCAN inx_owner_id select count(*) from t1,t2 where t1.id=t2.id and t1.owner='SCOTT';
INDEX FULL SCAN inx_id_owner select /*+ index(t1 inx_id_owner) */ count(*) from t1,t2 where t1.id=t2.id and t1.owner='SYS';
INDEX SKIP SCAN inx_id_owner select /*+ index_ss(t1 inx_id_owner) */ count(*) from t1,t2 where t1.id=t2.id and t1.owner = 'SYS';

组合索引怎么应该怎么选取引导列?