create table skewed_bool (id int auto_increment primary key, val int not null, flag bool not null, key(flag)) engine=innodb;
insert into skewed_bool(val, flag) values (5,0),(5,0),(5,1),(5,0),(5,0),(5,0),(5,0),(5,0);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);
insert into skewed_bool(val, flag) select 5, 0 from skewed_bool;
insert into skewed_bool(val, flag) values (5,1);

explain select count(1) from skewed_bool where val > 1 and flag = 1;
explain select count(1) from skewed_bool where val > 1 and flag = 0;
show index from skewed_bool;
analyze table skewed_bool;
show index from skewed_bool;
explain select count(1) from skewed_bool where val > 1 and flag = 1;
explain select count(1) from skewed_bool where val > 1 and flag = 0;
select count(1), flag from skewed_bool group by flag;

