On Thu, Jul 28, 2011 at 09:30:33AM +0000, Jason Ede wrote: > Even with auto_expiry off the system is still running really slow for a > remote server... The local server bayes updates go through really quickly, > but the remote servers queries are still backing up... > > i.e. from slow query log just now... > > # User@Host: sa_user[sa_user] @ gateway.XXX.XXX [XXX.XXX.XXX.XXX] # > Thread_id: 3363 Schema: bayes QC_hit: No # Query_time: 24.366423 > Lock_time: 0.000056 Rows_sent: 0 Rows_examined: 0 SET timestamp=1311845047; > INSERT INTO bayes_token > (id, token, spam_count, ham_count, atime) > VALUES ('1','รบ','0','1','1311844754') > ON DUPLICATE KEY UPDATE spam_count = GREATEST(spam_count + > '0', 0), > ham_count = GREATEST(ham_count + '1', > 0), > atime = GREATEST(atime, '1311844754');
Probably only marginal improvement, but drop atime index if you have it. Takes pointless resources updating it, if you run expiry once a day.