~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blitzdb/tests/r/range.result

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
drop table if exists t1;
2
 
create table t1 (a int, index(a)) engine = blitzdb;
3
 
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
4
 
insert into t1 values (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
5
 
insert into t1 values (21),(22),(23),(24),(25),(26),(27),(28),(29),(30);
6
 
insert into t1 values (31),(32),(33),(34),(35),(36),(37),(38),(39),(40);
7
 
insert into t1 values (41),(42),(43),(44),(45),(46),(47),(48),(49),(50);
8
 
insert into t1 values (51),(52),(53),(54),(55),(56),(57),(58),(59),(60);
9
 
select count(*) from t1;
10
 
count(*)
11
 
60
12
 
select max(a) from t1;
13
 
max(a)
14
 
60
15
 
select min(a) from t1;
16
 
min(a)
17
 
1
18
 
explain select * from t1 where a <= 30;
19
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
20
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
21
 
select * from t1 where a <= 30;
22
 
a
23
 
1
24
 
2
25
 
3
26
 
4
27
 
5
28
 
6
29
 
7
30
 
8
31
 
9
32
 
10
33
 
11
34
 
12
35
 
13
36
 
14
37
 
15
38
 
16
39
 
17
40
 
18
41
 
19
42
 
20
43
 
21
44
 
22
45
 
23
46
 
24
47
 
25
48
 
26
49
 
27
50
 
28
51
 
29
52
 
30
53
 
explain select * from t1 where a > 30;
54
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
55
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
56
 
select * from t1 where a > 30;
57
 
a
58
 
31
59
 
32
60
 
33
61
 
34
62
 
35
63
 
36
64
 
37
65
 
38
66
 
39
67
 
40
68
 
41
69
 
42
70
 
43
71
 
44
72
 
45
73
 
46
74
 
47
75
 
48
76
 
49
77
 
50
78
 
51
79
 
52
80
 
53
81
 
54
82
 
55
83
 
56
84
 
57
85
 
58
86
 
59
87
 
60
88
 
explain select * from t1 where a <= 10 limit 1;
89
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
90
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
91
 
select * from t1 where a <= 10 limit 1;
92
 
a
93
 
1
94
 
explain select * from t1 where a < 20 order by a desc;
95
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
96
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
97
 
select * from t1 where a < 20 order by a desc;
98
 
a
99
 
19
100
 
18
101
 
17
102
 
16
103
 
15
104
 
14
105
 
13
106
 
12
107
 
11
108
 
10
109
 
9
110
 
8
111
 
7
112
 
6
113
 
5
114
 
4
115
 
3
116
 
2
117
 
1
118
 
explain select * from t1 where a <= 10 order by a desc limit 1;
119
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
120
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
121
 
select * from t1 where a <= 10 order by a desc limit 1;
122
 
a
123
 
10
124
 
explain select * from t1 where a between 30 and 40;
125
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
126
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
127
 
select * from t1 where a between 30 and 40;
128
 
a
129
 
30
130
 
31
131
 
32
132
 
33
133
 
34
134
 
35
135
 
36
136
 
37
137
 
38
138
 
39
139
 
40
140
 
explain select * from t1 where a in (10, 20, 30, 40, 50, 60);
141
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
142
 
1       SIMPLE  t1      range   a       a       5       NULL    24      Using where; Using index
143
 
select * from t1 where a in (10, 20, 30, 40, 50, 60);
144
 
a
145
 
10
146
 
20
147
 
30
148
 
40
149
 
50
150
 
60
151
 
select * from t1 where a > 60;
152
 
a
153
 
select * from t1 where a < 0;
154
 
a
155
 
select * from t1 where a > 20 and a < 20;
156
 
a
157
 
select * from t1 where a is NULL;
158
 
a
159
 
drop table t1;
160
 
create table t1 (a bigint, index(a)) engine = blitzdb;
161
 
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
162
 
insert into t1 values (11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
163
 
insert into t1 values (21),(22),(23),(24),(25),(26),(27),(28),(29),(30);
164
 
insert into t1 values (31),(32),(33),(34),(35),(36),(37),(38),(39),(40);
165
 
insert into t1 values (41),(42),(43),(44),(45),(46),(47),(48),(49),(50);
166
 
insert into t1 values (51),(52),(53),(54),(55),(56),(57),(58),(59),(60);
167
 
explain select * from t1 where a <= 30;
168
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
169
 
1       SIMPLE  t1      range   a       a       9       NULL    4       Using where; Using index
170
 
select * from t1 where a <= 30;
171
 
a
172
 
1
173
 
2
174
 
3
175
 
4
176
 
5
177
 
6
178
 
7
179
 
8
180
 
9
181
 
10
182
 
11
183
 
12
184
 
13
185
 
14
186
 
15
187
 
16
188
 
17
189
 
18
190
 
19
191
 
20
192
 
21
193
 
22
194
 
23
195
 
24
196
 
25
197
 
26
198
 
27
199
 
28
200
 
29
201
 
30
202
 
explain select * from t1 where a > 30;
203
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
204
 
1       SIMPLE  t1      range   a       a       9       NULL    4       Using where; Using index
205
 
select * from t1 where a > 30;
206
 
a
207
 
31
208
 
32
209
 
33
210
 
34
211
 
35
212
 
36
213
 
37
214
 
38
215
 
39
216
 
40
217
 
41
218
 
42
219
 
43
220
 
44
221
 
45
222
 
46
223
 
47
224
 
48
225
 
49
226
 
50
227
 
51
228
 
52
229
 
53
230
 
54
231
 
55
232
 
56
233
 
57
234
 
58
235
 
59
236
 
60
237
 
explain select * from t1 where a <= 10 limit 1;
238
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
239
 
1       SIMPLE  t1      range   a       a       9       NULL    4       Using where; Using index
240
 
select * from t1 where a <= 10 limit 1;
241
 
a
242
 
1
243
 
explain select * from t1 where a < 20 order by a desc;
244
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
245
 
1       SIMPLE  t1      range   a       a       9       NULL    4       Using where; Using index
246
 
select * from t1 where a < 20 order by a desc;
247
 
a
248
 
19
249
 
18
250
 
17
251
 
16
252
 
15
253
 
14
254
 
13
255
 
12
256
 
11
257
 
10
258
 
9
259
 
8
260
 
7
261
 
6
262
 
5
263
 
4
264
 
3
265
 
2
266
 
1
267
 
select * from t1 where a < 5 order by a desc;
268
 
a
269
 
4
270
 
3
271
 
2
272
 
1
273
 
explain select * from t1 where a <= 10 order by a desc limit 1;
274
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
275
 
1       SIMPLE  t1      range   a       a       9       NULL    4       Using where; Using index
276
 
select * from t1 where a <= 10 order by a desc limit 1;
277
 
a
278
 
10
279
 
explain select * from t1 where a between 30 and 40;
280
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
281
 
1       SIMPLE  t1      range   a       a       9       NULL    4       Using where; Using index
282
 
select * from t1 where a between 30 and 40;
283
 
a
284
 
30
285
 
31
286
 
32
287
 
33
288
 
34
289
 
35
290
 
36
291
 
37
292
 
38
293
 
39
294
 
40
295
 
explain select * from t1 where a in (10, 20, 30, 40, 50, 60);
296
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
297
 
1       SIMPLE  t1      range   a       a       9       NULL    24      Using where; Using index
298
 
select * from t1 where a in (10, 20, 30, 40, 50, 60);
299
 
a
300
 
10
301
 
20
302
 
30
303
 
40
304
 
50
305
 
60
306
 
select * from t1 where a > 60;
307
 
a
308
 
select * from t1 where a < 0;
309
 
a
310
 
select * from t1 where a > 20 and a < 20;
311
 
a
312
 
select * from t1 where a is NULL;
313
 
a
314
 
drop table t1;
315
 
create table t1 (a double, index(a)) engine = blitzdb;
316
 
insert into t1 values (1.4), (1.3), (0.9), (1.0), (1.2), (1.1);
317
 
select * from t1;
318
 
a
319
 
0.9
320
 
1
321
 
1.1
322
 
1.2
323
 
1.3
324
 
1.4
325
 
explain select * from t1;
326
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
327
 
1       SIMPLE  t1      index   NULL    a       9       NULL    6       Using index
328
 
select * from t1 where a < 2.0;
329
 
a
330
 
0.9
331
 
1
332
 
1.1
333
 
1.2
334
 
1.3
335
 
1.4
336
 
select * from t1 where a > 0.01;
337
 
a
338
 
0.9
339
 
1
340
 
1.1
341
 
1.2
342
 
1.3
343
 
1.4
344
 
select * from t1 where a <= 1.1;
345
 
a
346
 
0.9
347
 
1
348
 
1.1
349
 
select * from t1 where a > 1.1;
350
 
a
351
 
1.2
352
 
1.3
353
 
1.4
354
 
select * from t1 where a in (0.9, 1.4, 1.1);
355
 
a
356
 
0.9
357
 
1.1
358
 
1.4
359
 
select * from t1 where a < 1.3 order by a;
360
 
a
361
 
0.9
362
 
1
363
 
1.1
364
 
1.2
365
 
select * from t1 where a < 1.3 order by a desc;
366
 
a
367
 
1.2
368
 
1.1
369
 
1
370
 
0.9
371
 
select * from t1 where a > 2.0;
372
 
a
373
 
select * from t1 where a < 0.01;
374
 
a
375
 
select * from t1 where a > 1.0 and a < 1.0;
376
 
a
377
 
select * from t1 where a is NULL;
378
 
a
379
 
drop table t1;
380
 
create table t1 (a date, index(a)) engine = blitzdb;
381
 
insert into t1 values ('2000-07-10'), ('2000-07-11'), ('2000-07-12');
382
 
insert into t1 values ('2000-08-13'), ('2000-08-14'), ('2000-08-15');
383
 
insert into t1 values ('2001-07-10'), ('2001-07-11'), ('2001-07-12');
384
 
insert into t1 values ('2001-08-13'), ('2001-08-14'), ('2001-08-15');
385
 
insert into t1 values ('2002-07-10'), ('2002-07-11'), ('2002-07-12');
386
 
insert into t1 values ('2002-08-13'), ('2002-08-14'), ('2002-08-15');
387
 
insert into t1 values ('2003-07-10'), ('2003-07-11'), ('2003-07-12');
388
 
insert into t1 values ('2003-08-13'), ('2003-08-14'), ('2003-08-15');
389
 
insert into t1 values ('2004-07-10'), ('2004-07-11'), ('2004-07-12');
390
 
insert into t1 values ('2004-08-13'), ('2004-08-14'), ('2004-08-15');
391
 
explain select * from t1 where a < '2002-01-01';
392
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
393
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
394
 
select * from t1 where a < '2002-01-01';
395
 
a
396
 
2000-07-10
397
 
2000-07-11
398
 
2000-07-12
399
 
2000-08-13
400
 
2000-08-14
401
 
2000-08-15
402
 
2001-07-10
403
 
2001-07-11
404
 
2001-07-12
405
 
2001-08-13
406
 
2001-08-14
407
 
2001-08-15
408
 
explain select * from t1 where a between '2002-01-01' and '2002-12-31';
409
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
410
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
411
 
select * from t1 where a between '2002-01-01' and '2002-12-31';
412
 
a
413
 
2002-07-10
414
 
2002-07-11
415
 
2002-07-12
416
 
2002-08-13
417
 
2002-08-14
418
 
2002-08-15
419
 
explain select * from t1 where a > '2000-01-01' and a < '2004-12-31';
420
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
421
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
422
 
select * from t1 where a > '2000-01-01' and a < '2004-12-31';
423
 
a
424
 
2000-07-10
425
 
2000-07-11
426
 
2000-07-12
427
 
2000-08-13
428
 
2000-08-14
429
 
2000-08-15
430
 
2001-07-10
431
 
2001-07-11
432
 
2001-07-12
433
 
2001-08-13
434
 
2001-08-14
435
 
2001-08-15
436
 
2002-07-10
437
 
2002-07-11
438
 
2002-07-12
439
 
2002-08-13
440
 
2002-08-14
441
 
2002-08-15
442
 
2003-07-10
443
 
2003-07-11
444
 
2003-07-12
445
 
2003-08-13
446
 
2003-08-14
447
 
2003-08-15
448
 
2004-07-10
449
 
2004-07-11
450
 
2004-07-12
451
 
2004-08-13
452
 
2004-08-14
453
 
2004-08-15
454
 
select count(*) from t1 where a > '2000-01-01' and a < '2004-12-31';
455
 
count(*)
456
 
30
457
 
explain select * from t1 where a < '2002-07-10' order by a;
458
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
459
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
460
 
select * from t1 where a < '2002-07-10' order by a;
461
 
a
462
 
2000-07-10
463
 
2000-07-11
464
 
2000-07-12
465
 
2000-08-13
466
 
2000-08-14
467
 
2000-08-15
468
 
2001-07-10
469
 
2001-07-11
470
 
2001-07-12
471
 
2001-08-13
472
 
2001-08-14
473
 
2001-08-15
474
 
explain select * from t1 where a < '2002-07-10' order by a desc;
475
 
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
476
 
1       SIMPLE  t1      range   a       a       5       NULL    4       Using where; Using index
477
 
select * from t1 where a < '2002-07-10' order by a desc;
478
 
a
479
 
2001-08-15
480
 
2001-08-14
481
 
2001-08-13
482
 
2001-07-12
483
 
2001-07-11
484
 
2001-07-10
485
 
2000-08-15
486
 
2000-08-14
487
 
2000-08-13
488
 
2000-07-12
489
 
2000-07-11
490
 
2000-07-10
491
 
select * from t1 where a > '2022-01-01';
492
 
a
493
 
select * from t1 where a < '2000-01-01';
494
 
a
495
 
select count(*) from t1;
496
 
count(*)
497
 
30
498
 
select * from t1;
499
 
a
500
 
2000-07-10
501
 
2000-07-11
502
 
2000-07-12
503
 
2000-08-13
504
 
2000-08-14
505
 
2000-08-15
506
 
2001-07-10
507
 
2001-07-11
508
 
2001-07-12
509
 
2001-08-13
510
 
2001-08-14
511
 
2001-08-15
512
 
2002-07-10
513
 
2002-07-11
514
 
2002-07-12
515
 
2002-08-13
516
 
2002-08-14
517
 
2002-08-15
518
 
2003-07-10
519
 
2003-07-11
520
 
2003-07-12
521
 
2003-08-13
522
 
2003-08-14
523
 
2003-08-15
524
 
2004-07-10
525
 
2004-07-11
526
 
2004-07-12
527
 
2004-08-13
528
 
2004-08-14
529
 
2004-08-15
530
 
drop table t1;