1
drop table if exists t1;
2
create table t1(n int not null, key(n));
3
select count(distinct n) from t1;
6
explain extended select count(distinct n) from t1;
7
id select_type table type possible_keys key key_len ref rows filtered Extra
8
1 SIMPLE t1 index NULL n 4 NULL # 100.00 Using index
10
Note 1003 select count(distinct `test`.`t1`.`n`) AS `count(distinct n)` from `test`.`t1`