I have drupal website, one of the tables is cache_form. I have a cron to
DELETE FROM cache_form where expire < UNIX_TIMESTAMP(NOW());
which works fine.
The size of cache_form.myd is 4.9G although I have this:
mysql>select sum(length(data))/1024/1204 from cache_form;
11.19144630 <b>==> 11 M
mysql>check table cache_form\G
Table: drupal.cache_form
Op: check
Msg_type: status
Msg_text: OK
mysql>select cid,length(data) from cache_form order by length(data) desc limit 1;
82373 ==> 80K
select * from information_schema.tables where table_name='cache_form'\G
*************************** 1. row ***************************
TABLE_CATALOG: NULL
TABLE_SCHEMA: drupal
TABLE_NAME: cache_form
TABLE_TYPE: BASE TABLE
ENGINE: MyISAM
VERSION: 10
ROW_FORMAT: Dynamic
TABLE_ROWS: 2681
AVG_ROW_LENGTH: 4621
DATA_LENGTH: 12391088 <b>==>11M</b>
MAX_DATA_LENGTH: 281474976710655
INDEX_LENGTH: 177152
DATA_FREE: 0
AUTO_INCREMENT: NULL
CREATE_TIME: 2011-07-11 19:07:38
UPDATE_TIME: 2011-12-26 08:40:09
CHECK_TIME: 2011-12-26 08:09:45
TABLE_COLLATION: utf8_general_ci
CHECKSUM: NULL
CREATE_OPTIONS:
TABLE_COMMENT:
I have tried to repair it
mysql> repair table cache_form;
+-------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+-------------------+--------+----------+----------+
| drupal.cache_form | repair | status | OK |
+-------------------+--------+----------+----------+
then I got the correct size!!
Any idea of what might cause cache_form.myd file to be with this size and repair table finally removed the extra space?
Thanks