use test; drop table if exists t1; create table t1 (id int unsigned auto_increment primary key, c1 char(12), c2 char(15), c3 char(1)) engine innodb; insert into t1 (c3) values ('1'), ('2'); insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; insert into t1 (c3) select c3 from t1; update t1 set c1=lpad(id+1000, 12, ' '), c2=lpad(id+10000, 15, ' '); alter table t1 add unique index (c1), add unique index (c2), add index (c3); analyze table t1; select *, 'default' plan from t1 where (c1=' 100000' or c2=' 2000000') and c3='2'; select *, 'ignore index (c3)' plan from t1 ignore index (c3) where (c1=' 100000' or c2=' 2000000') and c3='2'; #show index from t1; explain select * from t1 where (c1=' 100000' or c2=' 2000000') and c3='2'\G #explain select * from t1 ignore index (c3) where (c1=' 100000' or c2=' 2000000') and c3='2'\G