Recently We started on optimizing a database which never followed any standards.
We though to do the following.
clean up of unused tables.
optimizing data types and indexes.
tuning slow queries.
evaluating my.cnf configurations with mysqltuner.pl and similar ones
In this process i come across OPTIMIZING fragmented tables.
What is this fragmented table and how does this will impact the functionality and performance.
Why should i run OPTIMIZE on these tables…?
I believe this will not impact the functionality at all. please correct me if not.
Thanks in advance for the replies.
Regards,
UDAY
When you delete records (or update them to become smaller), the table will have “holes”, chunks of empty data, in it. Those will be filled with new data if it fits in the holes, but depending on how you use the table, there may be a significant amount of wasted space remaining. This is not good because you now need to read more blocks from the disk for the same amount of useful information.
Running the optimize command on these fragmented table will move the records around to get rid of the holes in the table.
After doing massive maintenance or update operations (such as bulk deletes) it is usually a good idea to do that.