收到table xxxx is full 报警
| table_schema | table_name | total_size_mb | data_used_mb | data_free_mb | TABLE_ROWS | ENGINE | ROW_FORMAT | pct_used |
+---------------+--------------------+---------------+--------------+--------------+------------+--------+------------+----------+
| schema-name1 | pre_common_session | 2.97 | 2.97 | 0.00 | 1 | MEMORY | Fixed | 100.00 |
| schema-name2 | pre_common_session | 0.05 | 0.05 | 0.00 | 165 | MEMORY | Fixed | 100.00 |
| schema-name3 | pre_common_session | 2.97 | 2.96 | 0.00 | 7 | MEMORY | Fixed | 99.97 |
| schema-name4 | pre_common_session | 2.97 | 2.97 | 0.00 | 1 | MEMORY | Fixed | 100.00 |
+---------------+--------------------+---------------+--------------+--------------+------------+--------+------------+----------+
4 rows in set (0.36 sec)
只有红色部分是特别差异.基于这点,我们去查看该表结构
mysql> show table status like 'pre_common_session'\G
*************************** 1. row ***************************
Name: pre_common_session
Engine: MEMORY
Version: 10
Row_format: Fixed
Rows: 153
Avg_row_length: 68
Data_length: 22120
Max_data_length: 10200
Index_length: 25760
Data_free: 816
Auto_increment: NULL
Create_time: NULL
Update_time: NULL
Check_time: NULL
Collation: gbk_chinese_ci
Checksum: NULL
Create_options: max_rows=150 ==========================》这个设置会对mysql最大空间计算产生影响,但并不是说表最大到150就不能再往上了。
但是到150以后,会很容易出现table XXXX FULL 的错误
而该表行数是165.所以很容易出现这个错误。
而通常出现table xxxx is full 就需要去看disk/max_heap_table_size 这两个是否到达上限了
解决如下
mysql> alter table pre_common_session max_rows=200;
Query OK, 177 rows affected (0.00 sec)
Records: 177 Duplicates: 0 Warnings: 0