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
|
-- source include/have_tokudb.inc
-- disable_query_log
set @orig_throttle = @@session.tokudb_analyze_throttle;
set @orig_time = @@session.tokudb_analyze_time;
set @orig_scale_percent = @@global.tokudb_cardinality_scale_percent;
create table tt (a int, b int, c int, d int, primary key(a), key(b), key(c), key(d)) engine=tokudb;
let $i=0;
while ($i < 1000) {
eval insert into tt values ($i, $i, $i, $i);
inc $i;
}
while ($i < 2000) {
eval insert into tt values ($i, $i, $i, 0);
inc $i;
}
while ($i < 3000) {
eval insert into tt values ($i, $i, 0, 0);
inc $i;
}
while ($i < 4000) {
eval insert into tt values ($i, 0, 0, 0);
inc $i;
}
set session tokudb_analyze_time=0;
set session tokudb_analyze_throttle=0;
-- enable_query_log
analyze table tt;
set global tokudb_cardinality_scale_percent = 10;
show indexes from tt;
set global tokudb_cardinality_scale_percent = 50;
show indexes from tt;
set global tokudb_cardinality_scale_percent = 100;
show indexes from tt;
set global tokudb_cardinality_scale_percent = 200;
show indexes from tt;
-- disable_query_log
drop table tt;
set session tokudb_analyze_throttle = @orig_throttle;
set session tokudb_analyze_time = @orig_time;
set global tokudb_cardinality_scale_percent = @orig_scale_percent;
-- enable_query_log
|