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 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
30
Table Unique Key_name Seq_in_index Column_name
33
33
alter table t1 engine=MyISAM;
34
34
show index from t1;
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
35
Table Unique Key_name Seq_in_index Column_name
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 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
311
Table Unique Key_name Seq_in_index Column_name
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
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 # # # # #
512
516
drop table t1,t2;
513
517
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
514
518
insert into t1 values (null,''), (null,'');
633
637
DELETE FROM t1 WHERE _id < 8;
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
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 # # # # #
637
642
Table Op Msg_type Msg_text
638
643
test.t1 check status OK
641
646
Table Op Msg_type Msg_text
642
647
test.t1 check status OK
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
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 # # # # #
645
651
SELECT _id FROM t1;
652
658
Variable_name Value
653
659
myisam_repair_threads 1
654
660
CREATE TEMPORARY TABLE t1 (c1 TEXT) ENGINE=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
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 # # # # #
658
665
CREATE TEMPORARY TABLE t1 (c1 TEXT NOT NULL, KEY c1 (c1(10))) ENGINE=MyISAM;
659
666
INSERT INTO t1 VALUES
1390
1397
Table Op Msg_type Msg_text
1391
1398
test.t1 analyze status OK
1392
1399
show keys from t1;
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
1400
Table Unique Key_name Seq_in_index Column_name
1395
1402
alter table t1 disable keys;
1397
1404
Note 1031 Table storage engine for 't1' doesn't have this option
1400
1407
Note 1031 Table storage engine for 't1' doesn't have this option
1401
1408
show keys from t1;
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
1409
Table Unique Key_name Seq_in_index Column_name
1405
1412
CREATE TEMPORARY TABLE t1(a INT, b INT, KEY inx (a), UNIQUE KEY uinx (b)) ENGINE=MyISAM;
1406
1413
INSERT INTO t1(a,b) VALUES (1,1),(2,2),(3,3),(4,4),(5,5);
1431
1438
CREATE TEMPORARY TABLE t1 (c1 INT, c2 INT, UNIQUE INDEX (c1), INDEX (c2)) ENGINE=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
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 # # # # #
1434
1442
INSERT INTO t1 VALUES (1,1);
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
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 # # # # #
1449
1462
# Enable keys with parallel repair
1450
1463
SET GLOBAL myisam_repair_threads=2;
1451
1464
ALTER TABLE t1 DISABLE KEYS;