Skip to content

Commit d20fa48

Browse files
committed
MDEV-13669: Some MyRocks test take a long time
Make rocksdb.cardinality test faster (77 -> 42 sec with --mem) by loading records in batches. (loading everything as one bulk load batch will remove the purpose of the test)
1 parent acaac7c commit d20fa48

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

storage/rocksdb/mysql-test/rocksdb/r/cardinality.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DROP TABLE IF EXISTS t1;
1+
DROP TABLE IF EXISTS t1,t10,t11;
22
create table t1(
33
id bigint not null primary key,
44
i1 bigint, #unique

storage/rocksdb/mysql-test/rocksdb/t/cardinality.test

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--source include/restart_mysqld.inc
44

55
--disable_warnings
6-
DROP TABLE IF EXISTS t1;
6+
DROP TABLE IF EXISTS t1,t10,t11;
77
--enable_warnings
88

99
create table t1(
@@ -18,13 +18,26 @@ create table t1(
1818
index t1_4(c1, c2),
1919
index t1_5(c2, c1)
2020
) engine=rocksdb;
21+
2122
--disable_query_log
23+
create table t10(a int primary key);
24+
insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
25+
26+
create table t11(a int primary key);
27+
insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C;
28+
29+
set @a=0;
2230
let $i=0;
23-
while ($i<100000)
31+
set rocksdb_bulk_load=1;
32+
while ($i<100)
2433
{
2534
inc $i;
26-
eval insert t1(id, i1, i2, c1, c2) values($i, $i, $i div 10, $i, $i div 10);
35+
eval insert into t1 select (@a:=@a+1), @a, @a div 10, @a, @a div 10 from t11;
2736
}
37+
set rocksdb_bulk_load=0;
38+
39+
drop table t10;
40+
drop table t11;
2841
--enable_query_log
2942

3043
# Flush memtable out to SST and display index cardinalities

0 commit comments

Comments
 (0)