For the longest time, I’ve had issues with trying to optimize the huge MySQL datatables that exist over at daria.be.
With over 6,000 tables, pulling up the database in something like
phpMyAdmin wasn’t working too well. Took about 20 minutes just to load
found a script on line that goes though table by table and optimizes it
if needbe. It runs through all of the databases accessable by the MySQL
user so it whould work on multidatabase installs of WPMu as well.
The code for the most part comes from here with some modifications made by myself to allow for the WPMu system. Instructions are included within the php file.
Download it from here. Should work on non-WPMu setups as well. Anything with large numbers of MySQL data tables.