On tor 24 sep 2009 04:57:57 CEST, "Steven W. Orr" wrote
Since I haven't *ever* touched this table for cleanup, the above
described cron job will not delete any rows for that period of time.

you will have less problems with innodb then myisam

here is my complete spamassassin sql setup, not showing tables that is
standard here

CREATE TABLE `awl` (
  `username` varchar(100) NOT NULL default '',
  `email` varchar(200) NOT NULL default '',
  `ip` varchar(10) NOT NULL default '',
  `count` int(11) default '0',
  `totscore` float default '0',
`lastupdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`username`,`email`,`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `bayes_seen` (
  `id` int(11) NOT NULL default '0',
`msgid` varchar(200) character set utf8 collate utf8_bin NOT NULL default '',
  `flag` char(1) NOT NULL default '',
`lastupdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  PRIMARY KEY  (`id`,`msgid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

this 2 table will need to be expired from cron

CREATE TABLE `bayes_token` (
  `id` int(11) NOT NULL default '0',
  `token` char(5) NOT NULL default '',
  `spam_count` int(11) NOT NULL default '0',
  `ham_count` int(11) NOT NULL default '0',
  `atime` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`,`token`),
  KEY `bayes_token_idx1` (`token`),
  KEY `bayes_token_idx2` (`id`,`atime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

last table will expire in standard way, this setup is
working in 3.2.5 and its not bugging down my mysql server

if you change your db to lastupdate now() then all data
will get added as today even thay are not added for real
today, but the expire will expire okay later

--
xpoint

Reply via email to