--source include/have_innodb.inc create table t1(id int not null auto_increment primary key, f1 int, f2 int, f3 int, key(f1, f2), key(f1, f3)) engine = innodb stats_persistent=1 stats_auto_recalc=0 stats_sample_pages=1; --disable_query_log insert into t1(f1, f2, f3) values(rand()*1000, rand()*1000, rand()*1000); insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; insert into t1(f1, f2, f3) select rand()*1000, rand()*1000, rand()*1000 from t1; --enable_query_log create table t2 like t1; insert into t2 select * from t1 order by f1; analyze table t2; select stat_value from mysql.innodb_index_stats where table_name='t2' and stat_description='f1'; show index from t2; analyze table t2; select stat_value from mysql.innodb_index_stats where table_name='t2' and stat_description='f1'; show index from t2; analyze table t2; select stat_value from mysql.innodb_index_stats where table_name='t2' and stat_description='f1'; show index from t2; drop table t1, t2;