On fre 02 okt 2009 04:47:56 CEST, "Steven W. Orr" wrote
I have all my SA tables up and running using InnoDB and using the
above table definitions. I just have one question:

Will the cronjob that was described here earlier

#!/bin/sh
howfar='where lastupdate < date_sub(now(), interval 3 month)'
mysql -h localhost -u sa -pssaa spamassassin <<EOF
        delete from awl $howfar ;
        delete from bayes_seen $howfar ;
EOF

also clean up the bayes_token table, or is there another cron job I

should use for that?

And, why is bayes_token.atime int(11) instead of
timestamp NOT NULL default CURRENT_TIMESTAMP on update
?

Is this a part of the design or is it more efficient?

ups i missed to post my cron and expire optimize part :=)

save as maint_bayes.sql

# http://www200.pair.com/mecham/spam/debian-spamassassin-sql.html

USE spamassassin
DELETE FROM awl WHERE lastupdate <= DATE_SUB(SYSDATE(), INTERVAL 6 MONTH);
DELETE FROM awl WHERE count = 1 AND lastupdate <= DATE_SUB(SYSDATE(), INTERVAL 60 DAY);

# remove local posted awl scores
DELETE FROM awl WHERE ip = 'none';

# delete where totscore is lower then -300
# DELETE FROM awl WHERE totscore <= -300;

# delete where count > 300
# DELETE FROM awl WHERE count > 300;

# delete here msgid generated by spamassassin that have not being seen last 3 month DELETE FROM bayes_seen WHERE lastupdate <= DATE_SUB(SYSDATE(), INTERVAL 30 DAY);

# index optimize on innodb
ALTER TABLE awl ENGINE=INNODB;
ALTER TABLE bayes_seen ENGINE=INNODB;
ALTER TABLE bayes_token ENGINE=INNODB;

# ixhash
# ALTER TABLE ixhash ENGINE=INNODB;

save as maint_amavisd.sql

USE amavisd
# index optimize on innodb
ALTER TABLE maddr ENGINE=INNODB;
ALTER TABLE msgrcpt ENGINE=INNODB;
ALTER TABLE msgs ENGINE=INNODB;
ALTER TABLE quarantine ENGINE=INNODB;

and finaly from cron hourly:

#!/bin/sh
cd /path/to/maintain-sql-dir/ && mysql -u user -ppassword -B < maint_amavisd.sql
cd /path/to/maintain-sql-dir/ && mysql -u user -ppassword -B < maint_bayes.sql


works fine on my 3.2.5 install, without any tears

--
xpoint

Reply via email to