MySQL中那些诡异的特性
先看一个现象 1 2 3 4 5 6 7 8 9 10 11 CREATE TABLE `type_test` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `num` bigint(20) unsigned NOT NULL, `str` varchar(1024) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `idx_num` (`num`) USING BTREE, KEY `idx_str` (`str`) USING BTREE ) DEFAULT CHARSET=utf8; EXPLAIN SELECT * FROM type_test where str=1; EXPLAIN SELECT * FROM type_test where num='13'; 你认为上述两个查询(输入的类型和实际类型不一致),是否都会命中索引呢? ...