You can do this
Code:
mysql -uadmin -p`cat /etc/psa/.psa.shadow ` tortix -Ns -e "create index timeid on alert (timestamp, id);";
You probably want to change your max packet size as well in the /etc/my.cnf file and enable caching
Code:
query_cache_size=16M
key_buffer_size=64M
thread_cache_size=12
table_cache=256
table_open_cache=256
query_cache_limit=64MB
max_allowed_packet = 128M
Then change the chunk size in the rotate script to match the max allowed packet
Code:
perl -pi -e 's/chunk_size=1000/chunk_size=128000/gi' /var/asl/bin/asl_db_rotate
Kill of any rotate scripts that are running - some of our boxes had instances of this script running for a week or even two, with a new one spawning up each night as part of the cron jobs, which didnt really help much for CPU or mysql
Code:
kill -9 `ps aux | grep rotate | grep -v grep | awk '{print $2}'`
and restart mysql
Code:
service mysqld restart