close

以下的例子:

mysql> show table status like 'weather' \G
*************************** 1. row ***************************
Name: weather
Type: MyISAM
Row_format: Dynamic
Rows: 0
Avg_row_length: 0
Data_length: 0
Max_data_length: 4294967295
Index_length: 1024
Data_free: 0
Auto_increment: NULL
Create_time: 2003-03-03 00:43:43
Update_time: 2003-03-03 00:43:43
Check_time: 2003-06-14 15:11:21
Create_options:
Comment:
1 row in set (0.00 sec)

看到 Max_data_length: 4294967295 ( 4GB ) 是 default 值

mysql> alter table weather max_rows = 200000000000 avg_row_length = 50;
Query OK, 0 rows affected (0.03 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> show table status like 'weather' \G
*************************** 1. row ***************************
Name: weather
Type: MyISAM
Row_format: Dynamic
Rows: 0
Avg_row_length: 0
Data_length: 0
Max_data_length: 1099511627775
Index_length: 1024
Data_free: 0
Auto_increment: NULL
Create_time: 2003-06-17 13:12:49
Update_time: 2003-06-17 13:12:49
Check_time: NULL
Create_options: max_rows=4294967295 avg_row_length=50
Comment:
1 row in set (0.00 sec)

做完上面的 alter table 之後,可以看到
Create_options: max_rows=4294967295 avg_row_length=50
Max_data_length: 1099511627775 ( 1TB ),也就是 200000000000 * 50
這樣,這個 table 就可以使用到 1TB 的大小囉!

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 uetoaya 的頭像
    uetoaya

    uetoaya的部落格

    uetoaya 發表在 痞客邦 留言(0) 人氣()