views:

193

answers:

1

I have a large (about 10 GB with a 20 GB innodb buffer pool) database, and have noticed that when I start it, for about the first half hour it's running, the database will periodically lock and unlock all tables, making it quite unpleasant for users who attempt to access our site for the first half hour after a database restart.

While I can't be 100% certain of the causal relationship, I notice that the time that the database is locking and unlocking itself coincides with the time that

/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf --all-databases --fast --silent

and

perl -e $_=join("", <>); s/^[^\n]+\n(error|note)\s+: The (handler|storage engine) for the table doesn.t support check\n//smg;print;

are running on my database server. My question is whether it's really necessary to run mysqlcheck (which is in the mysql /etc/init.d/mysql script by default) upon starting Mysql? The Google results I've found on mysqlcheck indicate that it "fixes & optimizes" tables, but I don't expect my tables to be broken, and I'm skeptical of the optimization advantages afforded by this utility.

If it matters, I'm running Mysql 5.0.32

+2  A: 

No.

This is a 'debian' feature that they modify from the stock MySQL. It is designed to stop people from getting into problems with corrupted MyISAM tables. Since you are using InnoDB, I would recommend you remove it. I believe it is part of the init.d script, so you could edit that to remove it.

Harrison Fisk
Excellent news! Thanks for the quick response!
wbharding