Reduced test case. It turns out that in 5.3 there is no need for all the subquery levels, 2 are enough.
create table t1 (a int not null);
set @@optimizer_switch='join_cache_hashed=on,semijoin=on'; set join_cache_level=3;
SET @@debug = 'd:t:O,/tmp/trace.out';
explain select a from t1 where a in ( select a from t1);
drop table t1;
Reduced test case.
It turns out that in 5.3 there is no need for
all the subquery levels, 2 are enough.
create table t1 (a int not null);
set @@optimizer_ switch= 'join_cache_ hashed= on,semijoin= on';
set join_cache_level=3;
SET @@debug = 'd:t:O, /tmp/trace. out';
explain
select a from t1 where a in ( select a from t1);
drop table t1;