Skip to content

Commit f17d5c1

Browse files
committed
#261 run multiple queries in part_index_scan
1 parent 3d4e10e commit f17d5c1

File tree

2 files changed

+216
-15
lines changed

2 files changed

+216
-15
lines changed

mysql-test/suite/tokudb.bugs/r/part_index_scan.result

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,185 @@ insert into t3 select * from t;
6464
select count(*) from t1;
6565
count(*)
6666
8388608
67+
select count(*) from t1;
68+
count(*)
69+
8388608
70+
select count(*) from t1;
71+
count(*)
72+
8388608
73+
select count(*) from t1;
74+
count(*)
75+
8388608
76+
select count(*) from t1;
77+
count(*)
78+
8388608
79+
select count(*) from t1;
80+
count(*)
81+
8388608
82+
select count(*) from t1;
83+
count(*)
84+
8388608
85+
select count(*) from t1;
86+
count(*)
87+
8388608
88+
select count(*) from t1;
89+
count(*)
90+
8388608
91+
select count(*) from t1;
92+
count(*)
93+
8388608
94+
select count(*) from t2;
95+
count(*)
96+
8388608
97+
select count(*) from t2;
98+
count(*)
99+
8388608
100+
select count(*) from t2;
101+
count(*)
102+
8388608
103+
select count(*) from t2;
104+
count(*)
105+
8388608
106+
select count(*) from t2;
107+
count(*)
108+
8388608
109+
select count(*) from t2;
110+
count(*)
111+
8388608
112+
select count(*) from t2;
113+
count(*)
114+
8388608
115+
select count(*) from t2;
116+
count(*)
117+
8388608
118+
select count(*) from t2;
119+
count(*)
120+
8388608
67121
select count(*) from t2;
68122
count(*)
69123
8388608
70124
1
71125
select count(*) from t3;
72126
count(*)
73127
8388608
128+
select count(*) from t3;
129+
count(*)
130+
8388608
131+
select count(*) from t3;
132+
count(*)
133+
8388608
134+
select count(*) from t3;
135+
count(*)
136+
8388608
137+
select count(*) from t3;
138+
count(*)
139+
8388608
140+
select count(*) from t3;
141+
count(*)
142+
8388608
143+
select count(*) from t3;
144+
count(*)
145+
8388608
146+
select count(*) from t3;
147+
count(*)
148+
8388608
149+
select count(*) from t3;
150+
count(*)
151+
8388608
152+
select count(*) from t3;
153+
count(*)
154+
8388608
74155
1
75156
select count(*) from t1 where num>7000000;
76157
count(*)
77158
1847274
159+
select count(*) from t1 where num>7000000;
160+
count(*)
161+
1847274
162+
select count(*) from t1 where num>7000000;
163+
count(*)
164+
1847274
165+
select count(*) from t1 where num>7000000;
166+
count(*)
167+
1847274
168+
select count(*) from t1 where num>7000000;
169+
count(*)
170+
1847274
171+
select count(*) from t1 where num>7000000;
172+
count(*)
173+
1847274
174+
select count(*) from t1 where num>7000000;
175+
count(*)
176+
1847274
177+
select count(*) from t1 where num>7000000;
178+
count(*)
179+
1847274
180+
select count(*) from t1 where num>7000000;
181+
count(*)
182+
1847274
183+
select count(*) from t1 where num>7000000;
184+
count(*)
185+
1847274
186+
select count(*) from t2 where num>7000000;
187+
count(*)
188+
1847274
189+
select count(*) from t2 where num>7000000;
190+
count(*)
191+
1847274
192+
select count(*) from t2 where num>7000000;
193+
count(*)
194+
1847274
195+
select count(*) from t2 where num>7000000;
196+
count(*)
197+
1847274
198+
select count(*) from t2 where num>7000000;
199+
count(*)
200+
1847274
201+
select count(*) from t2 where num>7000000;
202+
count(*)
203+
1847274
204+
select count(*) from t2 where num>7000000;
205+
count(*)
206+
1847274
207+
select count(*) from t2 where num>7000000;
208+
count(*)
209+
1847274
210+
select count(*) from t2 where num>7000000;
211+
count(*)
212+
1847274
78213
select count(*) from t2 where num>7000000;
79214
count(*)
80215
1847274
81216
1
82217
select count(*) from t3 where num>7000000;
83218
count(*)
84219
1847274
220+
select count(*) from t3 where num>7000000;
221+
count(*)
222+
1847274
223+
select count(*) from t3 where num>7000000;
224+
count(*)
225+
1847274
226+
select count(*) from t3 where num>7000000;
227+
count(*)
228+
1847274
229+
select count(*) from t3 where num>7000000;
230+
count(*)
231+
1847274
232+
select count(*) from t3 where num>7000000;
233+
count(*)
234+
1847274
235+
select count(*) from t3 where num>7000000;
236+
count(*)
237+
1847274
238+
select count(*) from t3 where num>7000000;
239+
count(*)
240+
1847274
241+
select count(*) from t3 where num>7000000;
242+
count(*)
243+
1847274
244+
select count(*) from t3 where num>7000000;
245+
count(*)
246+
1847274
85247
1
86248
drop table if exists t,t1,t2,t3;

mysql-test/suite/tokudb.bugs/t/part_index_scan.test

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# verify that index scans on parititions are not slow
2-
# due totokudb bulk fetch not being used
2+
# due to tokudb bulk fetch not being used
33
source include/have_tokudb.inc;
4-
source include/have_partition.inc;
54
set default_storage_engine='tokudb';
65
disable_warnings;
76
drop table if exists t,t1,t2,t3;
7+
enable_warnings;
8+
9+
let $debug = 0;
10+
let $maxq = 10;
811

912
CREATE TABLE `t` (
1013
`num` int(10) unsigned auto_increment NOT NULL,
@@ -13,6 +16,7 @@ CREATE TABLE `t` (
1316
);
1417

1518
# put 8M rows into t
19+
if ($debug) { let $ts = `select now()`; echo "start $ts"; }
1620
INSERT INTO t values (null,null);
1721
INSERT INTO t SELECT null,null FROM t;
1822
INSERT INTO t SELECT null,null FROM t;
@@ -37,7 +41,9 @@ INSERT INTO t SELECT null,null FROM t;
3741
INSERT INTO t SELECT null,null FROM t;
3842
INSERT INTO t SELECT null,null FROM t;
3943
INSERT INTO t SELECT null,null FROM t;
44+
if ($debug) { let $ts = `select now()`; echo "select $ts"; }
4045
SELECT count(*) FROM t;
46+
if ($debug) { let $ts = `select now()`; echo "select done $ts"; }
4147

4248
CREATE TABLE `t1` (
4349
`num` int(10) unsigned NOT NULL,
@@ -68,48 +74,81 @@ PARTITION BY RANGE (num)
6874
PARTITION p7 VALUES LESS THAN (8000000),
6975
PARTITION px VALUES LESS THAN MAXVALUE);
7076

77+
if ($debug) { let $ts = `select now()`; echo "insert t1 $ts"; }
7178
insert into t1 select * from t;
79+
if ($debug) { let $ts = `select now()`; echo "insert t2 $ts"; }
7280
insert into t2 select * from t;
81+
if ($debug) { let $ts = `select now()`; echo "insert t3 $ts"; }
7382
insert into t3 select * from t;
83+
if ($debug) { let $ts = `select now()`; echo "select t1 $ts"; }
7484

7585
# verify that full index scans on partitioned tables t2 and t3 are comparable to a non-partitioned table t1
7686
let $s = `select to_seconds(now())`;
77-
select count(*) from t1;
87+
let $i = 0;
88+
while ($i < $maxq) {
89+
select count(*) from t1;
90+
inc $i;
91+
}
7892
let $t1 = `select to_seconds(now()) - $s`;
79-
# echo $t1;
93+
94+
if ($debug) { let $ts = `select now()`; echo "select t2 $ts"; }
8095

8196
let $s = `select to_seconds(now())`;
82-
select count(*) from t2;
97+
let $i = 0;
98+
while ($i < $maxq) {
99+
select count(*) from t2;
100+
inc $i;
101+
}
83102
let $t2 = `select to_seconds(now()) - $s`;
84-
# echo $t2;
85103
let $d = `select abs($t2 - $t1) <= $t1`;
86104
echo $d;
87105

106+
if ($debug) { let $ts = `select now()`; echo "select t3 $ts"; }
107+
88108
let $s = `select to_seconds(now())`;
89-
select count(*) from t3;
109+
let $i = 0;
110+
while ($i < $maxq) {
111+
select count(*) from t3;
112+
inc $i;
113+
}
90114
let $t3 = `select to_seconds(now()) - $s`;
91-
# echo $t3;
92115
let $d = `select abs($t3 - $t1) <= $t1`;
93116
echo $d;
94117

118+
if ($debug) { let $ts = `select now()`; echo "select t1 $ts"; }
119+
95120
let $s = `select to_seconds(now())`;
96-
select count(*) from t1 where num>7000000;
121+
let $i = 0;
122+
while ($i < $maxq) {
123+
select count(*) from t1 where num>7000000;
124+
inc $i;
125+
}
97126
let $t1 = `select to_seconds(now()) - $s`;
98-
# echo $t1;
127+
128+
if ($debug) { let $ts = `select now()`; echo "select t2 $ts"; }
99129

100130
let $s = `select to_seconds(now())`;
101-
select count(*) from t2 where num>7000000;
131+
let $i = 0;
132+
while ($i < $maxq) {
133+
select count(*) from t2 where num>7000000;
134+
inc $i;
135+
}
102136
let $t2 = `select to_seconds(now()) - $s`;
103-
# echo $t2;
104137
let $d = `select abs($t2 - $t1) <= $t1`;
105138
echo $d;
106139

140+
if ($debug) { let $ts = `select now()`; echo "select t3 $ts"; }
141+
107142
let $s = `select to_seconds(now())`;
108-
select count(*) from t3 where num>7000000;
143+
let $i = 0;
144+
while ($i < $maxq) {
145+
select count(*) from t3 where num>7000000;
146+
inc $i;
147+
}
109148
let $t3 = `select to_seconds(now()) - $s`;
110-
# echo $t3;
111149
let $d = `select abs($t3 - $t1) <= $t1`;
112150
echo $d;
113151

114-
enable_warnings;
152+
if ($debug) { let $ts = `select now()`; echo "done $ts"; }
153+
115154
drop table if exists t,t1,t2,t3;

0 commit comments

Comments
 (0)