~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to tests/r/heap_hash.result

  • Committer: Padraig O'Sullivan
  • Date: 2010-03-15 14:05:26 UTC
  • mfrom: (1237.9.99 staging)
  • Revision ID: osullivan.padraig@gmail.com-20100315140526-opbgwdwn6tfecdkq
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
create temporary table t1 (a int not null,b int not null, primary key using HASH (a)) engine=MEMORY comment="testing heaps";
3
3
insert into t1 values(1,1),(2,2),(3,3),(4,4);
4
4
delete from t1 where a=1 or a=0;
 
5
show table status like "t1";
 
6
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
7
#       test    t1      TEMPORARY       MEMORY  #       #       #       #       #
5
8
show keys from t1;
6
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
7
 
t1      0       PRIMARY 1       a       NULL    3       NULL    NULL            HASH            
 
9
Table   Unique  Key_name        Seq_in_index    Column_name
 
10
t1      TRUE    PRIMARY 1       a
8
11
select * from t1;
9
12
a       b
10
13
2       2
32
35
create temporary table t1 (a int not null,b int not null, primary key using HASH (a)) engine=MEMORY comment="testing heaps";
33
36
insert into t1 values(1,1),(2,2),(3,3),(4,4);
34
37
alter table t1 modify a int not null auto_increment, engine=innodb, comment="new innodb table";
 
38
show table status like "t1";
 
39
Session Schema  Name    Type    Engine  Version Rows    Avg_row_length  Table_size      Auto_increment
 
40
#       test    t1      TEMPORARY       InnoDB  #       #       #       #       #
35
41
select * from t1;
36
42
a       b
37
43
1       1
320
326
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
321
327
1       SIMPLE  t1      ref     heap_idx        heap_idx        82      const   9       Using where
322
328
show index from t1;
323
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
324
 
t1      0       PRIMARY 1       id      NULL    91      NULL    NULL            HASH            
325
 
t1      1       heap_idx        1       name    NULL    10      NULL    NULL            HASH            
326
 
t1      1       btree_idx       1       name    A       NULL    NULL    NULL            BTREE           
 
329
Table   Unique  Key_name        Seq_in_index    Column_name
 
330
t1      TRUE    PRIMARY 1       id
 
331
t1      FALSE   heap_idx        1       name
 
332
t1      FALSE   btree_idx       1       name
327
333
show index from t1;
328
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
329
 
t1      0       PRIMARY 1       id      NULL    91      NULL    NULL            HASH            
330
 
t1      1       heap_idx        1       name    NULL    10      NULL    NULL            HASH            
331
 
t1      1       btree_idx       1       name    A       NULL    NULL    NULL            BTREE           
 
334
Table   Unique  Key_name        Seq_in_index    Column_name
 
335
t1      TRUE    PRIMARY 1       id
 
336
t1      FALSE   heap_idx        1       name
 
337
t1      FALSE   btree_idx       1       name
332
338
create temporary table t3
333
339
(
334
340
a varchar(20) not null,
337
343
) engine=MEMORY;
338
344
insert into t3 select name, name from t1;
339
345
show index from t3;
340
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
341
 
t3      1       a       1       a       NULL    NULL    NULL    NULL            HASH            
342
 
t3      1       a       2       b       NULL    13      NULL    NULL            HASH            
 
346
Table   Unique  Key_name        Seq_in_index    Column_name
 
347
t3      FALSE   a       1       a
 
348
t3      FALSE   a       2       b
343
349
show index from t3;
344
 
Table   Non_unique      Key_name        Seq_in_index    Column_name     Collation       Cardinality     Sub_part        Packed  Null    Index_type      Comment Index_Comment
345
 
t3      1       a       1       a       NULL    NULL    NULL    NULL            HASH            
346
 
t3      1       a       2       b       NULL    13      NULL    NULL            HASH            
 
350
Table   Unique  Key_name        Seq_in_index    Column_name
 
351
t3      FALSE   a       1       a
 
352
t3      FALSE   a       2       b
347
353
explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name;
348
354
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
349
355
1       SIMPLE  t1      ref     heap_idx        heap_idx        82      const   9       Using where