肥大化
mysql> select COUNT(*) from mysql.slow_log; +----------+ | COUNT(*) | +----------+ | 7890123 | +----------+ 1 row in set (9 min 59.43 sec) mysql> select COUNT(*) from mysql.slow_log_backup; +----------+ | COUNT(*) | +----------+ | 0 | +----------+ 1 row in set (0.01 sec)
ローテートしてみる
mysql> CALL mysql.rds_rotate_slow_log; Query OK, 0 rows affected (1.02 sec) mysql> select COUNT(*) from mysql.slow_log; +----------+ | COUNT(*) | +----------+ | 0 | +----------+ 1 row in set (0.01 sec) mysql> select COUNT(*) from mysql.slow_log_backup; +----------+ | COUNT(*) | +----------+ | 7890123 | +----------+ 1 row in set (11 min 37.41 sec)
バックアップも消す
もう一度 CALL mysql.rds_rotate_slow_log;
するとバックアップも消える
mysql> CALL mysql.rds_rotate_slow_log; Query OK, 0 rows affected (6.30 sec) mysql> select COUNT(*) from mysql.slow_log; +----------+ | COUNT(*) | +----------+ | 0 | +----------+ 1 row in set (0.01 sec) mysql> select COUNT(*) from mysql.slow_log_backup; +----------+ | COUNT(*) | +----------+ | 0 | +----------+ 1 row in set (0.01 sec)