views:

22

answers:

1

Hi,

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

+2  A: 

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.

Björn
Thanks a lot...I had previously thought that they had to be run fairly frequently on any table...so thanks :)
TMM