1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
CREATE TABLE `t5` ( `c1` varchar(255) NOT NULL DEFAULT '', c2 int, KEY `idx_c1` (`c1`), KEY idx_c2(c2) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
alter table t5 add column c3 bigint; alter table t5 add index idx_c3(c3); alter table t5 drop index idx_c3;
insert into t5(c1, c2) values('$', 16); insert into t5(c1, c2) values('!', 12); insert into t5(c1, c2) values('1', 16); insert into t5(c1, c2) values(' 1', 11); insert into t5(c1, c2) values('1a', 10);
select * from t5 where c1 = 0x24; + | c1 | c2 | + | $ | 16 | +
explain select * from t5 where c1 = 0x24; + | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | + | 1 | SIMPLE | t5 | NULL | ref | idx_c1 | idx_c1 | 767 | const | 1 | 100.00 | NULL | +
|