If you're still having database problems here are some general tips for myisam:
Run a table check while mysql is shutdown:
myisamchk -e /usr/local/mysql/data/moodledatabase/*.MYI
That will tell you if there is a problem with a table if so repair it using:
myisamchk -r /tablename.MYI
To optimize a table it is simple to do from a mysql prompt:
This can be an intensive time taking process.
Depending on how your database is being used there are a lot of variables in the my.cnf you can tweak to optimize system performance.
I'd look first at your query_cache_size and make sure it is set high. (you can tell by if your query cache hit ratio is less than about 60%)
I'd also increase the table cache to the number of moodle tables your site actively uses. In my case we set it at something like 64 before switching table engines.
You can also look at your sort_buffer which is used when ordering results which moodle asks for often.
For further diagnostic purposes, I'd recommend turning on the slow query log which can be done by adding this line to my.cnf:
(just make sure that directory exists and your mysql daemon can write to it.)
You can then use mysqldumpslow to get a read out of any queries that are affecting your performance which will also point you to areas to optimize.
Finally I'll suggest a consideration of switching to INNODB. INNODB is a more robust engine for SQL. It is ACID compliant (http://en.wikipedia.org/wiki/ACID) and much easier to configure. All you really need to do is throw all your memory at the innodb_buffer_pool. The downside is that it has a bit higher overhead because of its transactional nature, but its ease of tuning and lack of corruption often make it a better choice.