
daniel at cwa
Jul 28, 2013, 10:35 AM
Post #1 of 2
(60 views)
Permalink
|
|
Pruning Header table in DBmail 3
|
|
(Very sorry if this is a duplication, but I sent this on 26/07 and it never appeared in the digests I receive, so I assume it went astray - I've now completed the migration btw and the dump/restore took about 9 hours). I’m part way of through a migration from dbmail2.17 to 3.02 and I’ve gotten the stage where I need to perform a mysql dump/restore (no idea how long that will take with 150gb data; I’m hoping less than 48 hours) to reclaim the space from my innodb file. Before I do that however I thought it couldn’t hurt to prune some of the dbmail_header table as I would have for dbmail2.2.x Having deleted some likely headers by SELECT * FROM dbmail_headername where headername = "mime-version" Etc I noticed dbmail_headervalue wasn’t decreasing in size and the query SELECT * from dbmail_headervalue where id not in (select headervalue_id from dbmail_header) Returns a great many results, which to me implies they are orphaned. So have I missed something, has the mechanism for clearing out the old dbmail_header table changed in dbmail 3 in which case can someone tell me what the procedure is? Is it safe to delete anything from dbmail_headervalue not referenced in dbmail_header ? i.e. delete from dbmail_headervalue where id not in (select headervalue_id from dbmail_header) The object here is to reduce the size of the indices more than anything else as with a 16gb box and 6gb innodb buffer the indicies for the dbmail_header tables are larger than that already. Regards Daniel ------------------------ CWA International Balmoral House 9 John Street London WC1N 2ES (t) + 44 (0)20 7242 8444 (e) <mailto:dms [at] cwa> dms [at] cwa (w) <http://www.cwa.uk.com/> http://www.cwa.uk.com/
|