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
|
DROP TABLE IF EXISTS t1,t10,t11;
create table t1(
id bigint not null primary key,
i1 bigint, #unique
i2 bigint, #repeating
c1 varchar(20), #unique
c2 varchar(20), #repeating
index t1_1(id, i1),
index t1_2(i1, i2),
index t1_3(i2, i1),
index t1_4(c1, c2),
index t1_5(c2, c1)
) engine=rocksdb;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
show index in t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 id A 100000 NULL NULL LSMTREE
t1 1 t1_1 1 id A 100000 NULL NULL LSMTREE
t1 1 t1_1 2 i1 A 100000 NULL NULL YES LSMTREE
t1 1 t1_2 1 i1 A 100000 NULL NULL YES LSMTREE
t1 1 t1_2 2 i2 A 100000 NULL NULL YES LSMTREE
t1 1 t1_3 1 i2 A 11111 NULL NULL YES LSMTREE
t1 1 t1_3 2 i1 A 100000 NULL NULL YES LSMTREE
t1 1 t1_4 1 c1 A 100000 NULL NULL YES LSMTREE
t1 1 t1_4 2 c2 A 100000 NULL NULL YES LSMTREE
t1 1 t1_5 1 c2 A 11111 NULL NULL YES LSMTREE
t1 1 t1_5 2 c1 A 100000 NULL NULL YES LSMTREE
SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = DATABASE();
table_name table_rows
t1 100000
restarting...
show index in t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 id A 100000 NULL NULL LSMTREE
t1 1 t1_1 1 id A 100000 NULL NULL LSMTREE
t1 1 t1_1 2 i1 A 100000 NULL NULL YES LSMTREE
t1 1 t1_2 1 i1 A 100000 NULL NULL YES LSMTREE
t1 1 t1_2 2 i2 A 100000 NULL NULL YES LSMTREE
t1 1 t1_3 1 i2 A 11111 NULL NULL YES LSMTREE
t1 1 t1_3 2 i1 A 100000 NULL NULL YES LSMTREE
t1 1 t1_4 1 c1 A 100000 NULL NULL YES LSMTREE
t1 1 t1_4 2 c2 A 100000 NULL NULL YES LSMTREE
t1 1 t1_5 1 c2 A 11111 NULL NULL YES LSMTREE
t1 1 t1_5 2 c1 A 100000 NULL NULL YES LSMTREE
SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = DATABASE();
table_name table_rows
t1 100000
drop table t1;
|