Aleksander Kamenik wrote:
> Michael Monnerie wrote:
>> On Donnerstag, 12. Juli 2007 Aleksander Kamenik wrote:
>>> There also are no 20k messages set for deletion nor purging. Is it
>>> possible that these messages were left hanging? dbmail-util -ay
>>> didn't find anything wrong.
>>
>> Yes, I've had long discussions about this in a previous thread. You
>> can now do:
>>
>> DELETE FROM dbmail_physmessage WHERE id NOT IN (SELECT physmessage_id
>> FROM dbmail_messages);
>>
>> This will save you lots of space *g*
>>
>> To prevent such leftover physmessages in the future, I've developed
>> this RULE with the help of others, for postgres:
>>
>> CREATE RULE drop_messages_with_mailbox AS ON DELETE TO
>> dbmail_messages DO DELETE FROM dbmail_physmessage WHERE id =
>> OLD.physmessage_id AND id NOT IN (SELECT physmessage_id from
>> dbmail_messages);
> 
> Indeed:
> 
> mysql> select count(id) FROM dbmail_physmessage WHERE id NOT IN (SELECT
> physmessage_id
>     -> FROM dbmail_messages);

this query finds all physmessages that are not associated to any message
in a folder/mailbox.

> +-----------+
> | count(id) |
> +-----------+
> |     69977 |
> +-----------+
> 1 row in set (8.25 sec)
> 
> 
> Aaron or Paul, could you please confirm the issue and that these
> physmessages can be deleted?

Yes. You can delete them.

-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to