23
23
Table Op Msg_type Msg_text
24
24
test.t1 check status OK
26
create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
26
create TEMPORARY table t1 (a int not null auto_increment, b int not null, primary key (a), index(b)) ENGINE=MYISAM;
27
27
insert into t1 (b) values (1),(2),(2),(2),(2);
29
Table Op Msg_type Msg_text
30
test.t1 optimize status OK
32
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
33
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
34
t1 1 b 1 b A 5 NULL NULL BTREE
36
Table Op Msg_type Msg_text
37
test.t1 optimize status OK
39
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
40
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
41
t1 1 b 1 b A 5 NULL NULL BTREE
28
alter table t1 engine=MYISAM;
30
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
31
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
32
t1 1 b 1 b A NULL NULL NULL BTREE
33
alter table t1 engine=MyISAM;
35
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
36
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
37
t1 1 b 1 b A NULL NULL NULL BTREE
43
39
create temporary table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
44
40
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
67
63
id select_type table type possible_keys key key_len ref rows Extra
68
64
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
70
create table t1 ( t1 char(255), key(t1(250)));
72
Warning 1071 Specified key was too long; max key length is 767 bytes
66
create temporary table t1 ( t1 char(255), key(t1(250))) ENGINE=MYISAM;
73
67
insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169');
74
68
insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203');
75
69
insert t1 values ('213872387238723872387238723872387238723867376737673767376737673767376737673767');
99
93
insert t1 values ('70'), ('84'), ('60'), ('20'), ('76'), ('89'), ('49'), ('50'),
100
94
('88'), ('61'), ('42'), ('98'), ('39'), ('30'), ('25'), ('66'), ('61'), ('48'),
101
95
('80'), ('84'), ('98'), ('19'), ('91'), ('42'), ('47');
103
Table Op Msg_type Msg_text
104
test.t1 optimize status OK
96
alter table t1 ENGINE=myisam;
106
98
Table Op Msg_type Msg_text
107
99
test.t1 check status OK
314
306
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
315
307
create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
316
308
INSERT into t2 values (1,1,1), (2,2,2);
318
Table Op Msg_type Msg_text
319
test.t1 optimize note The storage engine for the table doesn't support optimize
309
alter table t1 ENGINE=MYISAM;
320
310
show index from t1;
321
311
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
322
312
t1 1 b 1 b A NULL NULL NULL YES BTREE
647
637
Table Op Msg_type Msg_text
648
638
test.t1 check status OK
650
Table Op Msg_type Msg_text
651
test.t1 optimize note The storage engine for the table doesn't support optimize
639
ALTER TABLE t1 ENGINE=MYISAM;
653
641
Table Op Msg_type Msg_text
654
642
test.t1 check status OK