2.05.2010

MySQL key_cache for MyISAM

Knowing the total size of all your indexes is helpful when setting your key_cache size. This one-liner gives you that number in bytes.

find /var/lib/mysql/ -name "*.MYI" -printf "%s\n" | awk '{ s += $1}; END { print s }'