27
27
insert into t1 (b) values (1),(2),(2),(2),(2);
28
28
alter table t1 engine=MYISAM;
29
29
show index from t1;
30
Table Unique Key_name Seq_in_index Column_name
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
33
alter table t1 engine=MyISAM;
34
34
show index from t1;
35
Table Unique Key_name Seq_in_index Column_name
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
39
39
create temporary table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=myisam;
40
40
insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
308
308
INSERT into t2 values (1,1,1), (2,2,2);
309
309
alter table t1 ENGINE=MYISAM;
310
310
show index from t1;
311
Table Unique Key_name Seq_in_index Column_name
311
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
312
t1 1 b 1 b A NULL NULL NULL YES BTREE
313
t1 1 c 1 c A NULL NULL NULL YES BTREE
314
t1 1 a 1 a A NULL NULL NULL BTREE
315
t1 1 a 2 b A NULL NULL NULL YES BTREE
316
t1 1 c_2 1 c A NULL NULL NULL YES BTREE
317
t1 1 c_2 2 a A NULL NULL NULL BTREE
318
318
explain select * from t1,t2 where t1.a=t2.a;
319
319
id select_type table type possible_keys key key_len ref rows Extra
320
320
1 SIMPLE t2 ALL a NULL NULL NULL 2
490
490
insert t2 select * from t1;
491
491
checksum table t1, t2, t3;
497
Error 1146 Table 'test.t3' doesn't exist
498
checksum table t1, t2, t3;
504
Error 1146 Table 'test.t3' doesn't exist
505
checksum table t1, t2, t3;
511
Error 1146 Table 'test.t3' doesn't exist
513
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
514
# test t1 STANDARD InnoDB # # # # #
515
# test t2 STANDARD InnoDB # # # # #
497
Error 1146 Table 'test.t3' doesn't exist
498
checksum table t1, t2, t3;
504
Error 1146 Table 'test.t3' doesn't exist
505
checksum table t1, t2, t3;
511
Error 1146 Table 'test.t3' doesn't exist
516
512
drop table t1,t2;
517
513
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
518
514
insert into t1 values (null,''), (null,'');
637
633
DELETE FROM t1 WHERE _id < 8;
638
show table status LIKE 't1';
639
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
640
# test t1 TEMPORARY MyISAM # # # # #
634
SHOW TABLE STATUS LIKE 't1';
635
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
642
637
Table Op Msg_type Msg_text
643
638
test.t1 check status OK
646
641
Table Op Msg_type Msg_text
647
642
test.t1 check status OK
648
show table status LIKE 't1';
649
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
650
# test t1 TEMPORARY MyISAM # # # # #
643
SHOW TABLE STATUS LIKE 't1';
644
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
651
645
SELECT _id FROM t1;
658
652
Variable_name Value
659
653
myisam_repair_threads 1
660
654
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=MyISAM;
661
show table status like 't1';
662
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
663
# test t1 TEMPORARY MyISAM # # # # #
655
SHOW TABLE STATUS LIKE 't1';
656
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
665
658
CREATE TEMPORARY TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
666
659
INSERT INTO t1 VALUES
1397
1390
Table Op Msg_type Msg_text
1398
1391
test.t1 analyze status OK
1399
1392
show keys from t1;
1400
Table Unique Key_name Seq_in_index Column_name
1393
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
1394
t1 1 a 1 a A 8 NULL NULL YES BTREE
1402
1395
alter table t1 disable keys;
1404
1397
Note 1031 Table storage engine for 't1' doesn't have this option
1407
1400
Note 1031 Table storage engine for 't1' doesn't have this option
1408
1401
show keys from t1;
1409
Table Unique Key_name Seq_in_index Column_name
1402
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_Comment
1403
t1 1 a 1 a A 8 NULL NULL YES BTREE
1412
1405
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
1413
1406
INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
1438
1431
CREATE TEMPORARY TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=MYISAM;
1439
show table status like 't1';
1440
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1441
# test t1 TEMPORARY MyISAM # # # # #
1432
SHOW TABLE STATUS LIKE 't1';
1433
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
1442
1434
INSERT INTO t1 VALUES (1,1);
1443
show table status like 't1';
1444
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1445
# test t1 TEMPORARY MyISAM # # # # #
1446
ALTER TABLE t1 DISABLE KEYS;
1447
show table status like 't1';
1448
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1449
# test t1 TEMPORARY MyISAM # # # # #
1450
ALTER TABLE t1 ENABLE KEYS;
1451
show table status like 't1';
1452
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1453
# test t1 TEMPORARY MyISAM # # # # #
1454
ALTER TABLE t1 DISABLE KEYS;
1455
show table status like 't1';
1456
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1457
# test t1 TEMPORARY MyISAM # # # # #
1458
ALTER TABLE t1 ENABLE KEYS;
1459
show table status like 't1';
1460
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
1461
# test t1 TEMPORARY MyISAM # # # # #
1435
SHOW TABLE STATUS LIKE 't1';
1436
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
1437
ALTER TABLE t1 DISABLE KEYS;
1438
SHOW TABLE STATUS LIKE 't1';
1439
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
1440
ALTER TABLE t1 ENABLE KEYS;
1441
SHOW TABLE STATUS LIKE 't1';
1442
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
1443
ALTER TABLE t1 DISABLE KEYS;
1444
SHOW TABLE STATUS LIKE 't1';
1445
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
1446
ALTER TABLE t1 ENABLE KEYS;
1447
SHOW TABLE STATUS LIKE 't1';
1448
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
1462
1449
# Enable keys with parallel repair
1463
1450
SET GLOBAL myisam_repair_threads=2;
1464
1451
ALTER TABLE t1 DISABLE KEYS;