~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Testing of PRELOAD
3
#
4
5
--disable_warnings
6
drop table if exists t1, t2;
7
--enable_warnings
8
9
10
create table t1 (
11
  a int not null auto_increment,
12
  b char(16) not null,
13
  primary key (a),
14
  key (b)
15
);
16
17
create table t2(
18
  a int not null auto_increment,
19
  b char(16) not null,
20
  primary key (a),
21
  key (b)
22
);
23
24
insert into t1(b) values 
25
  ('test0'),
26
  ('test1'),
27
  ('test2'),
28
  ('test3'),
29
  ('test4'),
30
  ('test5'),
31
  ('test6'),
32
  ('test7');
33
  
34
insert into t2(b) select b from t1;
35
insert into t1(b) select b from t2;  
36
insert into t2(b) select b from t1;  
37
insert into t1(b) select b from t2;  
38
insert into t2(b) select b from t1;  
39
insert into t1(b) select b from t2;  
40
insert into t2(b) select b from t1;  
41
insert into t1(b) select b from t2;  
42
insert into t2(b) select b from t1;  
43
insert into t1(b) select b from t2;  
44
insert into t2(b) select b from t1;  
45
insert into t1(b) select b from t2;  
46
insert into t2(b) select b from t1;  
47
insert into t1(b) select b from t2;  
48
insert into t2(b) select b from t1;  
49
insert into t1(b) select b from t2;  
50
insert into t2(b) select b from t1;  
51
insert into t1(b) select b from t2;  
52
53
select count(*) from t1;
54
select count(*) from t2;
55
56
flush tables; flush status;
57
show status like "key_read%";
58
59
select count(*) from t1 where b = 'test1';
60
show status like "key_read%";
61
select count(*) from t1 where b = 'test1';
62
show status like "key_read%";
63
64
flush tables; flush status;
65
select @@preload_buffer_size;
66
load index into cache t1;
67
show status like "key_read%";
68
select count(*) from t1 where b = 'test1';
69
show status like "key_read%";
70
71
flush tables; flush status;
72
show status like "key_read%";
73
set session preload_buffer_size=256*1024;
74
select @@preload_buffer_size;
75
load index into cache t1 ignore leaves;
76
show status like "key_read%";
77
select count(*) from t1 where b = 'test1';
78
show status like "key_read%";
79
80
flush tables; flush status; 
81
show status like "key_read%";
82
set session preload_buffer_size=1*1024;
83
select @@preload_buffer_size;
84
load index into cache t1, t2 key (primary,b) ignore leaves;
85
show status like "key_read%";
86
select count(*) from t1 where b = 'test1';
87
select count(*) from t2 where b = 'test1';
88
show status like "key_read%";
89
90
flush tables; flush status;
91
show status like "key_read%";
92
load index into cache t3, t2 key (primary,b) ;
93
show status like "key_read%";
94
95
flush tables; flush status;
96
show status like "key_read%";
97
load index into cache t3 key (b), t2 key (c) ;
98
show status like "key_read%";
99
100
drop table t1, t2;
101
102
# End of 4.1 tests