Something is missing in the constraints or dbmail-util clean up. With 0 
messages, then headernames/headervalues should be 0 as well. I'm glad to 
see that headers is 0 as it should be.

These should clean up the extra rows. Please note that these will take a 
while on a database with a lot of header caching and messages still 
present. Took 15 mins to kill 36899 rows (5037478 rows remain) for just 
the first one for me (mysql). Second one took only 25 seconds to kill 
241 rows (5328 rows remain). I have 492531 physmessages.

DELETE FROM dbmail_headervalue where id NOT IN (SELECT 
DISTINCT(headervalue_id) FROM dbmail_header);
DELETE FROM dbmail_headername where id NOT IN (SELECT 
DISTINCT(headername_id) FROM dbmail_header);


-Jon

Piotr Wadas wrote:
> actually this is what left after delete/purge/vacuum (PG 8.3)
> dbmail_users, dbmail_subscriptions, and dbmail_mailboxes is reasonable,
> but I expect headernames and header values to be empty too.
>
>           table_name          | how_many_rows
> ------------------------+------
>  dbmail_aliases         |    0
>  dbmail_authlog         |    0
>  dbmail_envelope        |    0
>  dbmail_filters         |    0
>  dbmail_header          |    0
>  dbmail_mimeparts       |    0
>  dbmail_pbsp            |    0
>  dbmail_physmessage     |    0
>  dbmail_referencesfield |    0
>  dbmail_replycache      |    0
>  dbmail_sievescripts    |    0
>  dbmail_usermap         |    0
>  dbmail_keywords        |    0
>  dbmail_messageblks     |    0
>  dbmail_messages        |    0
>  dbmail_acl             |    0
>  dbmail_partlists       |    0
>  dbmail_users           |    5
>  dbmail_mailboxes       |    6
>  dbmail_subscription    |    6
>  dbmail_headername      |   58
>  dbmail_headervalue     | 2052
> (24 rows)
>
>   


-- 
Scanned for viruses and dangerous content by MailScanner

_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail

Reply via email to