Depending on how heavily the DB is used, you might want to go through this routine once or twice a month. You can also use myisamchk or mysqlchk to do this from a shell or DOS prompt.
Main Topics
Browse All TopicsHi ppl,
I am just wondering whether the MySQL table will need to do reindexing after a period of time? As far as I am concerned, POSTGRESQL will need to do this after to period of time to restructure the table index.
I had browse through the net for the answer but it seems that I can't find any related articles on that or any syntax that is related to re-indexing a table?
Anyone who can drop any advice for me?
Thanks in advance..
Cheers,
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi!
You don't need to reindex MySQL's tables; ... this is one of the major benefits of the long lasting MySQL Vs Postgress discussion where Postgress requires you to run vacuum every certain amount of time.
From the manual:
OPTIMIZE TABLE should be used if you have deleted a large part of a table or if you have made many changes to a table with variable-length rows (tables that have VARCHAR, BLOB, or TEXT columns). Deleted records are maintained in a linked list and subsequent INSERT operations reuse old record positions. You can use OPTIMIZE TABLE to reclaim the unused space and to defragment the datafile.
In most setups you don't have to run OPTIMIZE TABLE at all. Even if you do a lot of updates to variable length rows it's not likely that you need to do this more than once a month/week and only on certain tables.
Business Accounts
Answer for Membership
by: SqueebeePosted on 2004-01-17 at 21:51:17ID: 10139386
ANALYZE TABLE tablename;
That will help mysql make better choices about index usage.
OPTIMIZE TABLE tablename;
Use to defragment a table that had a large delete.
REPAIR TABLE tablename;
Fixes corrupted tables/index.
If all goes well you may need the occasional ANALYZE TABLE, but you should not need to rebuild the index itself on any regular basis.