为什么mysql不使用index_merge?
看起来我的服务器有 index_merge ON,但优化器仍然没有考虑。
optimizer switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
explain SELECT a,b FROM `zip25` WHERE b=91367 OR a=91367
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE zip25 ALL a,b NULL NULL NULL 752299 Using where
[编辑]
表定义
CREATE TABLE `zip25` (
`a` char(5) DEFAULT NULL,
`b` char(5) DEFAULT NULL,
`distance` float NOT NULL,
KEY `a` (`a`),
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
提前致谢