summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/t/cardinality.test
blob: df2b0673315892cd745d5b077e271276a8f14324 (plain)
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
--source include/have_rocksdb.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

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;
--disable_query_log
let $i=0;
while ($i<100000)
{
  inc $i;
  eval insert t1(id, i1, i2, c1, c2) values($i, $i, $i div 10, $i, $i div 10);
}
--enable_query_log

# Flush memtable out to SST and display index cardinalities
optimize table t1;
show index in t1;
SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = DATABASE();

--echo restarting...
--source include/restart_mysqld.inc

# display index cardinalities after the restart
show index in t1;
SELECT table_name, table_rows FROM information_schema.tables WHERE table_schema = DATABASE();

drop table t1;