~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/distinct.result

Reverted 1103

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
176
176
1       SIMPLE  t1      ALL     PRIMARY NULL    NULL    NULL    4       Using temporary
177
177
1       SIMPLE  t2      ref     a       a       4       test.t1.a       1       Using index
178
 
1       SIMPLE  t3      ref     a       a       5       test.t1.b       1       Using where; Using index
 
178
1       SIMPLE  t3      ref     a       a       5       test.t1.b       1       Using index
179
179
SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
180
180
a
181
181
1
190
190
explain select distinct t1.a from t1,t3 where t1.a=t3.a;
191
191
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
192
192
1       SIMPLE  t1      index   PRIMARY PRIMARY 4       NULL    4       Using index; Using temporary
193
 
1       SIMPLE  t3      ref     a       a       5       test.t1.a       1       Using where; Using index; Distinct
 
193
1       SIMPLE  t3      ref     a       a       5       test.t1.a       1       Using index; Distinct
194
194
select distinct t1.a from t1,t3 where t1.a=t3.a;
195
195
a
196
196
1
197
197
2
198
 
show status like 'Handler%';
199
 
Variable_name   Value
200
 
Handler_commit  #
201
 
Handler_delete  #
202
 
Handler_prepare #
203
 
Handler_read_first      #
204
 
Handler_read_key        #
205
 
Handler_read_next       #
206
 
Handler_read_prev       #
207
 
Handler_read_rnd        #
208
 
Handler_read_rnd_next   #
209
 
Handler_rollback        #
210
 
Handler_savepoint       #
211
 
Handler_savepoint_rollback      #
212
 
Handler_update  #
213
 
Handler_write   #
214
 
flush status;
215
198
select distinct 1 from t1,t3 where t1.a=t3.a;
216
199
1
217
200
1
218
 
show status like 'Handler%';
219
 
Variable_name   Value
220
 
Handler_commit  #
221
 
Handler_delete  #
222
 
Handler_prepare #
223
 
Handler_read_first      #
224
 
Handler_read_key        #
225
 
Handler_read_next       #
226
 
Handler_read_prev       #
227
 
Handler_read_rnd        #
228
 
Handler_read_rnd_next   #
229
 
Handler_rollback        #
230
 
Handler_savepoint       #
231
 
Handler_savepoint_rollback      #
232
 
Handler_update  #
233
 
Handler_write   #
234
201
explain SELECT distinct t1.a from t1;
235
202
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
236
203
1       SIMPLE  t1      index   NULL    PRIMARY 4       NULL    4       Using index
397
364
SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
398
365
email   shipcode
399
366
test1@testdomain.com    Z001
 
367
test2@testdomain.com    Z001
400
368
test2@testdomain.com    R002
401
 
test2@testdomain.com    Z001
402
369
test3@testdomain.com    Z001
403
370
SELECT DISTINCTROW email FROM t1 ORDER BY dateentered DESC;
404
371
email
523
490
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
524
491
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    3       
525
492
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2;
526
 
ERROR HY000: Implicit cartesian join attempted.
 
493
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
494
1       SIMPLE  t1_1    ALL     NULL    NULL    NULL    NULL    3       Using temporary
 
495
1       SIMPLE  t1_2    index   NULL    PRIMARY 4       NULL    3       Using index; Distinct; Using join buffer
527
496
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2
528
497
WHERE t1_1.a = t1_2.a;
529
498
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
499
1       SIMPLE  t1_2    index   PRIMARY PRIMARY 4       NULL    3       Using index; Using temporary
530
500
1       SIMPLE  t1_1    ALL     PRIMARY NULL    NULL    NULL    3       Using where; Using join buffer
531
 
1       SIMPLE  t1_2    index   PRIMARY PRIMARY 4       NULL    3       Using index; Using temporary
532
501
EXPLAIN SELECT a FROM t1 GROUP BY a;
533
502
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
534
503
1       SIMPLE  t1      index   NULL    PRIMARY 4       NULL    3       Using index