MySQL 分析和优化 - 如果仅插入且表没有联接,是否需要它们?
我在MySQL中有一个MyISAM表,它由两个字段(f1无符号整数,f2无符号整数)组成,包含3.2亿行。我在 f2 上有一个索引。每周我都会向该表中插入大约 150,000 行。我想知道我需要在此表上运行“分析”和“优化”的频率是多少(因为它可能需要很长时间并同时阻塞)?我不执行任何删除或更新语句,只是每周插入新行。另外,我没有在任何联接中使用此表,因此,根据此信息,真的需要“分析”和“优化”吗?
提前致谢, 蒂姆
I have a MyISAM table in MySQL which consists of two fields (f1 integer unsigned, f2 integer unsigned) and contains 320 million rows. I have an index on f2. Every week I insert about 150,000 rows into this table. I would like to know what is the frequency with which I need to run "analyze" and "optimize" on this table (as it would probably take a long time and block in the meantime)? I do not do any deletes or update statements, but just insert new rows every week. Also, I am not using this table in any joins so, based on this information, are "analyze" and "optimize" really required?
Thanks in advance,
Tim
分析表
检查键,优化表
一种重组表的方式。如果您从未...从未...删除或更新表中的数据,仅插入新数据,则不需要分析或优化。
ANALYZE TABLE
checks the keys,OPTIMIZE TABLE
kind of reorganizes tables.If you never...ever... delete or update the data in your table, only insert new ones, you won't need analyze or optimize.