1set default_storage_engine='tokudb'; 2drop table if exists t1,t2; 3CREATE TABLE `t1` ( 4`num` int(10) unsigned auto_increment NOT NULL, 5`val` varchar(32) DEFAULT NULL, 6PRIMARY KEY (`num`) 7); 8CREATE TABLE `t2` ( 9`count` bigint(20) NOT NULL 10); 11INSERT INTO t1 values (null,null); 12INSERT INTO t1 SELECT null,val FROM t1; 13INSERT INTO t1 SELECT null,val FROM t1; 14INSERT INTO t1 SELECT null,val FROM t1; 15INSERT INTO t1 SELECT null,val FROM t1; 16INSERT INTO t1 SELECT null,val FROM t1; 17INSERT INTO t1 SELECT null,val FROM t1; 18INSERT INTO t1 SELECT null,val FROM t1; 19INSERT INTO t1 SELECT null,val FROM t1; 20INSERT INTO t1 SELECT null,val FROM t1; 21INSERT INTO t1 SELECT null,val FROM t1; 22INSERT INTO t1 SELECT null,val FROM t1; 23INSERT INTO t1 SELECT null,val FROM t1; 24INSERT INTO t1 SELECT null,val FROM t1; 25INSERT INTO t1 SELECT null,val FROM t1; 26INSERT INTO t1 SELECT null,val FROM t1; 27INSERT INTO t1 SELECT null,val FROM t1; 28INSERT INTO t1 SELECT null,val FROM t1; 29INSERT INTO t1 SELECT null,val FROM t1; 30INSERT INTO t1 SELECT null,val FROM t1; 31INSERT INTO t1 SELECT null,val FROM t1; 32SELECT count(*) FROM t1; 33count(*) 341048576 35set tokudb_bulk_fetch=ON; 36REPLACE into t2 SELECT count(*) from t1; 37REPLACE into t2 SELECT count(*) from t1; 38REPLACE into t2 SELECT count(*) from t1; 39REPLACE into t2 SELECT count(*) from t1; 40REPLACE into t2 SELECT count(*) from t1; 41REPLACE into t2 SELECT count(*) from t1; 42REPLACE into t2 SELECT count(*) from t1; 43REPLACE into t2 SELECT count(*) from t1; 44REPLACE into t2 SELECT count(*) from t1; 45REPLACE into t2 SELECT count(*) from t1; 46REPLACE into t2 SELECT count(*) from t1; 47REPLACE into t2 SELECT count(*) from t1; 48REPLACE into t2 SELECT count(*) from t1; 49REPLACE into t2 SELECT count(*) from t1; 50REPLACE into t2 SELECT count(*) from t1; 51REPLACE into t2 SELECT count(*) from t1; 52REPLACE into t2 SELECT count(*) from t1; 53REPLACE into t2 SELECT count(*) from t1; 54REPLACE into t2 SELECT count(*) from t1; 55REPLACE into t2 SELECT count(*) from t1; 56set tokudb_bulk_fetch=OFF; 57REPLACE into t2 SELECT count(*) from t1; 58REPLACE into t2 SELECT count(*) from t1; 59REPLACE into t2 SELECT count(*) from t1; 60REPLACE into t2 SELECT count(*) from t1; 61REPLACE into t2 SELECT count(*) from t1; 62REPLACE into t2 SELECT count(*) from t1; 63REPLACE into t2 SELECT count(*) from t1; 64REPLACE into t2 SELECT count(*) from t1; 65REPLACE into t2 SELECT count(*) from t1; 66REPLACE into t2 SELECT count(*) from t1; 67REPLACE into t2 SELECT count(*) from t1; 68REPLACE into t2 SELECT count(*) from t1; 69REPLACE into t2 SELECT count(*) from t1; 70REPLACE into t2 SELECT count(*) from t1; 71REPLACE into t2 SELECT count(*) from t1; 72REPLACE into t2 SELECT count(*) from t1; 73REPLACE into t2 SELECT count(*) from t1; 74REPLACE into t2 SELECT count(*) from t1; 75REPLACE into t2 SELECT count(*) from t1; 76REPLACE into t2 SELECT count(*) from t1; 771 78set tokudb_bulk_fetch=ON; 79REPLACE into t2 SELECT count(*) from t1 where num > 700000; 80REPLACE into t2 SELECT count(*) from t1 where num > 700000; 81REPLACE into t2 SELECT count(*) from t1 where num > 700000; 82REPLACE into t2 SELECT count(*) from t1 where num > 700000; 83REPLACE into t2 SELECT count(*) from t1 where num > 700000; 84REPLACE into t2 SELECT count(*) from t1 where num > 700000; 85REPLACE into t2 SELECT count(*) from t1 where num > 700000; 86REPLACE into t2 SELECT count(*) from t1 where num > 700000; 87REPLACE into t2 SELECT count(*) from t1 where num > 700000; 88REPLACE into t2 SELECT count(*) from t1 where num > 700000; 89REPLACE into t2 SELECT count(*) from t1 where num > 700000; 90REPLACE into t2 SELECT count(*) from t1 where num > 700000; 91REPLACE into t2 SELECT count(*) from t1 where num > 700000; 92REPLACE into t2 SELECT count(*) from t1 where num > 700000; 93REPLACE into t2 SELECT count(*) from t1 where num > 700000; 94REPLACE into t2 SELECT count(*) from t1 where num > 700000; 95REPLACE into t2 SELECT count(*) from t1 where num > 700000; 96REPLACE into t2 SELECT count(*) from t1 where num > 700000; 97REPLACE into t2 SELECT count(*) from t1 where num > 700000; 98REPLACE into t2 SELECT count(*) from t1 where num > 700000; 99set tokudb_bulk_fetch=OFF; 100REPLACE into t2 SELECT count(*) from t1 where num > 700000; 101REPLACE into t2 SELECT count(*) from t1 where num > 700000; 102REPLACE into t2 SELECT count(*) from t1 where num > 700000; 103REPLACE into t2 SELECT count(*) from t1 where num > 700000; 104REPLACE into t2 SELECT count(*) from t1 where num > 700000; 105REPLACE into t2 SELECT count(*) from t1 where num > 700000; 106REPLACE into t2 SELECT count(*) from t1 where num > 700000; 107REPLACE into t2 SELECT count(*) from t1 where num > 700000; 108REPLACE into t2 SELECT count(*) from t1 where num > 700000; 109REPLACE into t2 SELECT count(*) from t1 where num > 700000; 110REPLACE into t2 SELECT count(*) from t1 where num > 700000; 111REPLACE into t2 SELECT count(*) from t1 where num > 700000; 112REPLACE into t2 SELECT count(*) from t1 where num > 700000; 113REPLACE into t2 SELECT count(*) from t1 where num > 700000; 114REPLACE into t2 SELECT count(*) from t1 where num > 700000; 115REPLACE into t2 SELECT count(*) from t1 where num > 700000; 116REPLACE into t2 SELECT count(*) from t1 where num > 700000; 117REPLACE into t2 SELECT count(*) from t1 where num > 700000; 118REPLACE into t2 SELECT count(*) from t1 where num > 700000; 119REPLACE into t2 SELECT count(*) from t1 where num > 700000; 1201 121drop table t1,t2; 122