~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/heap_btree.result

  • Committer: Monty Taylor
  • Date: 2010-08-21 02:55:13 UTC
  • mfrom: (1711.6.12 staging)
  • Revision ID: mordred@inaugust.com-20100821025513-3xyidjf8dodeh4gy
Remove btree heap index.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
alter table t1 add unique uniq_id using BTREE (a);
55
55
select * from t1 where a > 736494;
56
56
a
 
57
869751
57
58
802616
58
 
869751
59
59
select * from t1 where a = 736494;
60
60
a
61
61
736494
79
79
insert into t1 values (1,1),(2,2),(1,3),(2,4),(2,5),(2,6);
80
80
explain select * from t1 where x=1;
81
81
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
82
 
1       SIMPLE  t1      ref     x       x       4       const   1       
 
82
1       SIMPLE  t1      ALL     x       NULL    NULL    NULL    6       Using where
83
83
select * from t1 where x=1;
84
84
x       y
85
85
1       1
109
109
select * from t1 where a=1;
110
110
a       b
111
111
1       1
 
112
1       2
 
113
1       3
 
114
1       4
 
115
1       5
 
116
1       6
112
117
1       1
113
118
1       2
114
 
1       2
115
 
1       3
116
 
1       3
117
 
1       4
118
 
1       4
119
 
1       5
120
 
1       5
121
 
1       6
 
119
1       3
 
120
1       4
 
121
1       5
122
122
1       6
123
123
explain select * from tx where a=x order by a,b;
124
124
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
125
 
x       SIMPLE  tx      ref     a       a       x       const   x       Using where
 
125
x       SIMPLE  tx      ALL     a       NULL    NULL    NULL    x       Using where; Using filesort
126
126
explain select * from tx where a=x order by b;
127
127
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
128
 
x       SIMPLE  tx      ref     a       a       x       const   x       Using where
 
128
x       SIMPLE  tx      ALL     a       NULL    NULL    NULL    x       Using where; Using filesort
129
129
select * from t1 where b=1;
130
130
a       b
131
131
1       1
173
173
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
174
174
explain select * from t1 where btn like "i%";
175
175
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
176
 
1       SIMPLE  t1      range   btn     btn     42      NULL    1       Using where
 
176
1       SIMPLE  t1      ALL     btn     NULL    NULL    NULL    14      Using where
177
177
explain select * from t1 where btn like "h%";
178
178
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
179
 
1       SIMPLE  t1      range   btn     btn     42      NULL    #       Using where
 
179
1       SIMPLE  t1      ALL     btn     NULL    NULL    NULL    #       Using where
180
180
explain select * from t1 where btn like "a%";
181
181
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
182
 
1       SIMPLE  t1      range   btn     btn     42      NULL    1       Using where
 
182
1       SIMPLE  t1      ALL     btn     NULL    NULL    NULL    14      Using where
183
183
explain select * from t1 where btn like "b%";
184
184
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
185
 
1       SIMPLE  t1      range   btn     btn     42      NULL    1       Using where
 
185
1       SIMPLE  t1      ALL     btn     NULL    NULL    NULL    14      Using where
186
186
select * from t1 where btn like "ff%";
187
187
btn
188
188
select * from t1 where btn like " %";
193
193
update t1 set new_col=left(btn,1);
194
194
explain select * from t1 where btn="a";
195
195
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
196
 
1       SIMPLE  t1      ref     btn     btn     42      const   1       Using where
 
196
1       SIMPLE  t1      ALL     btn     NULL    NULL    NULL    14      Using where
197
197
explain select * from t1 where btn="a" and new_col="a";
198
198
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
199
 
1       SIMPLE  t1      ref     btn     btn     48      const,const     1       Using where
 
199
1       SIMPLE  t1      ref     btn     btn     48      const,const     2       Using where
200
200
drop table t1;
201
201
CREATE TEMPORARY TABLE t1 (
202
202
a int default NULL,
209
209
a       b
210
210
explain SELECT * FROM t1 WHERE a IS NULL;
211
211
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
212
 
1       SIMPLE  t1      ref     a       a       5       const   1       Using where
 
212
1       SIMPLE  t1      ref     a       a       5       const   2       Using where
213
213
SELECT * FROM t1 WHERE a<=>NULL;
214
214
a       b
215
215
NULL    99
315
315
insert into t1 values (1, 1), (3, 3), (2, 2), (NULL, 1), (NULL, NULL), (0, 0);
316
316
select * from t1 where a is null;
317
317
a       b
 
318
NULL    1
318
319
NULL    NULL
319
 
NULL    1
320
320
drop table t1;
321
321
End of 5.0 tests