1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
Data will be ordered in ascending order
CREATE TABLE t1(
pk CHAR(5),
a CHAR(30),
b CHAR(30),
PRIMARY KEY(pk) COMMENT "rev:cf1",
KEY(a)
) ENGINE=ROCKSDB COLLATE 'latin1_bin';
CREATE TABLE t2(
pk CHAR(5),
a CHAR(30),
b CHAR(30),
PRIMARY KEY(pk) COMMENT "rev:cf1",
KEY(a)
) ENGINE=ROCKSDB COLLATE 'latin1_bin';
CREATE TABLE t3(
pk CHAR(5),
a CHAR(30),
b CHAR(30),
PRIMARY KEY(pk) COMMENT "rev:cf1",
KEY(a)
) ENGINE=ROCKSDB COLLATE 'latin1_bin' PARTITION BY KEY() PARTITIONS 4;
connect other,localhost,root,,;
set session transaction isolation level repeatable read;
start transaction with consistent snapshot;
select VALUE > 0 as 'Has opened snapshots' from information_schema.rocksdb_dbstats where stat_type='DB_NUM_SNAPSHOTS';
Has opened snapshots
1
connection default;
SET @@GLOBAL.ROCKSDB_UPDATE_CF_OPTIONS=
'cf1={write_buffer_size=8m;target_file_size_base=1m};';
set rocksdb_bulk_load=1;
set rocksdb_bulk_load_size=100000;
LOAD DATA INFILE <input_file> INTO TABLE t1;
pk a b
LOAD DATA INFILE <input_file> INTO TABLE t2;
pk a b
LOAD DATA INFILE <input_file> INTO TABLE t3;
pk a b
set rocksdb_bulk_load=0;
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL # # NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL # # NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL # # NULL latin1_bin NULL partitioned 0 N
ANALYZE TABLE t1, t2, t3;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL # # NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL # # NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL # # NULL latin1_bin NULL partitioned 0 N
select count(pk),count(a) from t1;
count(pk) count(a)
2500000 2500000
select count(b) from t1;
count(b)
2500000
select count(pk),count(a) from t2;
count(pk) count(a)
2500000 2500000
select count(b) from t2;
count(b)
2500000
select count(pk),count(a) from t3;
count(pk) count(a)
2500000 2500000
select count(b) from t3;
count(b)
2500000
longfilenamethatvalidatesthatthiswillgetdeleted.bulk_load.tmp
test.bulk_load.tmp
# restart
disconnect other;
DROP TABLE t1, t2, t3;
|