~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/subselect3.result

  • Committer: Brian Aker
  • Date: 2008-07-20 09:02:20 UTC
  • Revision ID: brian@tangent.org-20080720090220-bhrg1wemfnzutbgi
Convert default engine to Innodb

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
select oref, a, a in (select a from t1 where oref=t2.oref) Z from t2;
90
90
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
91
91
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    4       100.00  
92
 
2       DEPENDENT SUBQUERY      t1      index_subquery  a       a       5       func    2       100.00  Using where; Full scan on NULL key
 
92
2       DEPENDENT SUBQUERY      t1      ALL     a       NULL    NULL    NULL    5       80.00   Using where
93
93
Warnings:
94
94
Note    1276    Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
95
 
Note    1003    select "test"."t2"."oref" AS "oref","test"."t2"."a" AS "a",<in_optimizer>("test"."t2"."a",<exists>(<index_lookup>(<cache>("test"."t2"."a") in t1 on a checking NULL where ("test"."t1"."oref" = "test"."t2"."oref") having trigcond(<is_not_null_test>("test"."t1"."a"))))) AS "Z" from "test"."t2"
 
95
Note    1003    select "test"."t2"."oref" AS "oref","test"."t2"."a" AS "a",<in_optimizer>("test"."t2"."a",<exists>(select 1 AS "Not_used" from "test"."t1" where (("test"."t1"."oref" = "test"."t2"."oref") and trigcond(((<cache>("test"."t2"."a") = "test"."t1"."a") or isnull("test"."t1"."a")))) having trigcond(<is_not_null_test>("test"."t1"."a")))) AS "Z" from "test"."t2"
96
96
flush status;
97
97
select oref, a from t2 where a in (select a from t1 where oref=t2.oref);
98
98
oref    a
111
111
0       NULL    0
112
112
show status like '%Handler_read%';
113
113
Variable_name   Value
114
 
Handler_read_first      0
115
 
Handler_read_key        0
 
114
Handler_read_first      5
 
115
Handler_read_key        10
116
116
Handler_read_next       0
117
117
Handler_read_prev       0
118
118
Handler_read_rnd        0
153
153
from t3;
154
154
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
155
155
1       PRIMARY t3      ALL     NULL    NULL    NULL    NULL    3       100.00  
156
 
2       DEPENDENT SUBQUERY      t1      ref_or_null     a       a       5       func    4       100.00  Using where; Full scan on NULL key
 
156
2       DEPENDENT SUBQUERY      t1      ref_or_null     a       a       5       func    2       100.00  Using where; Full scan on NULL key
157
157
2       DEPENDENT SUBQUERY      t2      ref     a       a       5       test.t1.b       1       100.00  Using where
158
158
Warnings:
159
159
Note    1276    Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1
181
181
from t3;
182
182
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
183
183
1       PRIMARY t3      ALL     NULL    NULL    NULL    NULL    3       100.00  
184
 
2       DEPENDENT SUBQUERY      t1      ref     a       a       4       func    2       100.00  Using where; Full scan on NULL key
 
184
2       DEPENDENT SUBQUERY      t1      ref     a       a       4       func    1       100.00  Using where; Full scan on NULL key
185
185
2       DEPENDENT SUBQUERY      t2      ref     a       a       4       test.t1.b       1       100.00  Using where
186
186
Warnings:
187
187
Note    1276    Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1
254
254
from t2;
255
255
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
256
256
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    2       100.00  
257
 
2       DEPENDENT SUBQUERY      t1      ref_or_null     a       a       5       func    2       100.00  Using where; Full scan on NULL key
 
257
2       DEPENDENT SUBQUERY      t1      ALL     a       NULL    NULL    NULL    10      80.00   Using where
258
258
2       DEPENDENT SUBQUERY      t4      ALL     NULL    NULL    NULL    NULL    100     100.00  Using where; Using join buffer
259
259
Warnings:
260
260
Note    1276    Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
300
300
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2 where a=10 and b=10;
301
301
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
302
302
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    8       100.00  Using where
303
 
2       DEPENDENT SUBQUERY      t1      index_subquery  idx     idx     5       func    4       100.00  Using where; Full scan on NULL key
 
303
2       DEPENDENT SUBQUERY      t1      ALL     idx     NULL    NULL    NULL    11      81.82   Using where
304
304
Warnings:
305
305
Note    1276    Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
306
 
Note    1003    select "test"."t2"."oref" AS "oref","test"."t2"."a" AS "a","test"."t2"."b" AS "b",<in_optimizer>(("test"."t2"."a","test"."t2"."b"),<exists>(<index_lookup>(<cache>("test"."t2"."a") in t1 on idx checking NULL where (("test"."t1"."oref" = "test"."t2"."oref") and trigcond(((<cache>("test"."t2"."a") = "test"."t1"."ie1") or isnull("test"."t1"."ie1"))) and trigcond(((<cache>("test"."t2"."b") = "test"."t1"."ie2") or isnull("test"."t1"."ie2")))) having (trigcond(<is_not_null_test>("test"."t1"."ie1")) and trigcond(<is_not_null_test>("test"."t1"."ie2")))))) AS "Z" from "test"."t2" where (("test"."t2"."b" = 10) and ("test"."t2"."a" = 10))
 
306
Note    1003    select "test"."t2"."oref" AS "oref","test"."t2"."a" AS "a","test"."t2"."b" AS "b",<in_optimizer>(("test"."t2"."a","test"."t2"."b"),<exists>(select "test"."t1"."ie1" AS "ie1","test"."t1"."ie2" AS "ie2" from "test"."t1" where (("test"."t1"."oref" = "test"."t2"."oref") and trigcond(((<cache>("test"."t2"."a") = "test"."t1"."ie1") or isnull("test"."t1"."ie1"))) and trigcond(((<cache>("test"."t2"."b") = "test"."t1"."ie2") or isnull("test"."t1"."ie2")))) having (trigcond(<is_not_null_test>("test"."t1"."ie1")) and trigcond(<is_not_null_test>("test"."t1"."ie2"))))) AS "Z" from "test"."t2" where (("test"."t2"."b" = 10) and ("test"."t2"."a" = 10))
307
307
drop table t1, t2;
308
308
create table t1 (oref char(4), grp int, ie int);
309
309
insert into t1 (oref, grp, ie) values
409
409
explain select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2;
410
410
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
411
411
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    7       
412
 
2       DEPENDENT SUBQUERY      t1      index_subquery  idx     idx     5       func    4       Using where; Full scan on NULL key
 
412
2       DEPENDENT SUBQUERY      t1      ALL     idx     NULL    NULL    NULL    10      Using where
413
413
select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2;
414
414
oref    a       Z
415
415
ee      NULL    NULL
432
432
explain select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2;
433
433
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
434
434
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    7       
435
 
2       DEPENDENT SUBQUERY      t1      ref_or_null     idx     idx     10      test.t2.oref,func       4       Using where; Using index; Full scan on NULL key
 
435
2       DEPENDENT SUBQUERY      t1      ref_or_null     idx     idx     10      test.t2.oref,func       10      Using where; Using index; Full scan on NULL key
436
436
select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2;
437
437
oref    a       Z
438
438
ee      NULL    NULL
457
457
from t2;
458
458
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
459
459
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    7       
460
 
2       DEPENDENT SUBQUERY      t1      ref     idx     idx     5       test.t2.oref    2       Using where; Using temporary; Using filesort
 
460
2       DEPENDENT SUBQUERY      t1      ref     idx     idx     5       test.t2.oref    5       Using where; Using temporary; Using filesort
461
461
select oref, a, 
462
462
a in (select min(ie) from t1 where oref=t2.oref 
463
463
group by grp having min(ie) > 1) Z 
548
548
explain select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2;
549
549
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
550
550
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    7       
551
 
2       DEPENDENT SUBQUERY      t1      index_subquery  idx     idx     5       func    4       Using where; Full scan on NULL key
 
551
2       DEPENDENT SUBQUERY      t1      ALL     idx     NULL    NULL    NULL    10      Using where
552
552
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2;
553
553
oref    a       b       Z
554
554
ee      NULL    1       NULL
570
570
select oref, a, b, (a,b) in (select ie1,ie2 from t1 where oref=t2.oref) Z from t2;
571
571
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
572
572
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    7       100.00  
573
 
2       DEPENDENT SUBQUERY      t1      index_subquery  idx     idx     5       func    4       100.00  Using where; Full scan on NULL key
 
573
2       DEPENDENT SUBQUERY      t1      ALL     idx     NULL    NULL    NULL    10      80.00   Using where
574
574
Warnings:
575
575
Note    1276    Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
576
 
Note    1003    select "test"."t2"."oref" AS "oref","test"."t2"."a" AS "a","test"."t2"."b" AS "b",<in_optimizer>(("test"."t2"."a","test"."t2"."b"),<exists>(<index_lookup>(<cache>("test"."t2"."a") in t1 on idx checking NULL where (("test"."t1"."oref" = "test"."t2"."oref") and trigcond(((<cache>("test"."t2"."a") = "test"."t1"."ie1") or isnull("test"."t1"."ie1"))) and trigcond(((<cache>("test"."t2"."b") = "test"."t1"."ie2") or isnull("test"."t1"."ie2")))) having (trigcond(<is_not_null_test>("test"."t1"."ie1")) and trigcond(<is_not_null_test>("test"."t1"."ie2")))))) AS "Z" from "test"."t2"
 
576
Note    1003    select "test"."t2"."oref" AS "oref","test"."t2"."a" AS "a","test"."t2"."b" AS "b",<in_optimizer>(("test"."t2"."a","test"."t2"."b"),<exists>(select "test"."t1"."ie1" AS "ie1","test"."t1"."ie2" AS "ie2" from "test"."t1" where (("test"."t1"."oref" = "test"."t2"."oref") and trigcond(((<cache>("test"."t2"."a") = "test"."t1"."ie1") or isnull("test"."t1"."ie1"))) and trigcond(((<cache>("test"."t2"."b") = "test"."t1"."ie2") or isnull("test"."t1"."ie2")))) having (trigcond(<is_not_null_test>("test"."t1"."ie1")) and trigcond(<is_not_null_test>("test"."t1"."ie2"))))) AS "Z" from "test"."t2"
577
577
drop table t1,t2;
578
578
create table t1 (oref char(4), grp int, ie int primary key);
579
579
insert into t1 (oref, grp, ie) values
607
607
bb      NULL    NULL
608
608
select oref, a from t2 where a in (select ie from t1 where oref=t2.oref);
609
609
oref    a
 
610
aa      1
610
611
cc      5
611
 
aa      1
612
612
select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref);
613
613
oref    a
614
614
ee      NULL
724
724
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
725
725
1       PRIMARY t1      ALL     NULL    NULL    NULL    NULL    4       Using where
726
726
2       DEPENDENT SUBQUERY      t2      eq_ref  PRIMARY PRIMARY 4       func    1       Using where; Using index; Full scan on NULL key
727
 
2       DEPENDENT SUBQUERY      t3      eq_ref  PRIMARY PRIMARY 4       func    1       Using index condition; Using where; Full scan on NULL key
 
727
2       DEPENDENT SUBQUERY      t3      eq_ref  PRIMARY PRIMARY 4       func    1       Using where; Full scan on NULL key
728
728
SELECT * FROM t1
729
729
WHERE t1.id NOT IN (SELECT t2.id FROM t2,t3 
730
730
WHERE t3.name='xxx' AND t2.id=t3.id);