Am 02.10.2013 12:07, schrieb Thomas Raschbacher:
> On 2013-10-02 11:27, Reindl Harald wrote:
>>> and yes i worded that badly I mean until it is done once I can't run this 
>>> daily
>>
>> you can run it daily after that - the problem with no cleanups at all
>> over a long time is that most likely there are some hundret thousand
>> records which now get removed
>>
>> http://dbmail.10918.n7.nabble.com/Housekeeping-dbmail-headervalue-td16954.html
>>
>> delete from dbmail.dbmail_headername where id not in (select
>> headername_id from dbmail.dbmail_header) limit 50000;
>> delete from dbmail.dbmail_headervalue where id not in (select
>> headervalue_id from dbmail.dbmail_header) limit 50000;
>>
> 
> I ran a select query with count(*) (from that post) about 20 minutes ago... 
> -- it is not done yet O.o

because count(*) on InnoDB is terrible slow :-)
http://www.mysqltalk.org/select-count-select-countcolumn-in-innodb-vt144555.html

the delete is much faster, i had these queries in my dail cronjob over the last 
year

> well guess i just have let it run until it is done. Although this might be 
> good as some extra option like the
> migration with limit as well so that it doesn'T take forever ;)
> @paul what do you think about putting some limit on this? -- since if most 
> people run a daily cronjob it would also
> get done eventually (or you could run it manually with a higher limit i 
> suppose)

AFAIK somewhere on the todo-list is a whitelist which headers are cached at all
99% of the headers in a typical mail are irrelevant junk and not used in the
context of the header-cache which is used for a lot of IMAP list commands

having only the relevant ones in these tables would dramatically reduce
table- and key-sizes as well as record-count

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
DBmail mailing list
DBmail@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to