Michael Monnerie wrote:
>
> But how do you delete messageblks without their entire message? There 
> are lots of constraints all over the place. You'd need to redefine 
> those. OK, as there will be no more old inserts, it shouldn't really 
> hurt to loose those.
> If "per-user" is not good - what would be better?
>
> mfg zmi
I just did a test delete of an old message

mysql> select * from dbmail_physmessage where id=1000;
+------+-------------+---------+---------------------+
| id   | messagesize | rfcsize | internal_date       |
+------+-------------+---------+---------------------+
| 1000 |        2164 |    2226 | 2003-07-12 09:13:57 |
+------+-------------+---------+---------------------+
1 row in set (0.02 sec)

mysql> delete from dbmail_messageblks where physmessage_id=1000;
Query OK, 2 rows affected (0.00 sec)

mysql> select * from dbmail_physmessage where id=1000;
+------+-------------+---------+---------------------+
| id   | messagesize | rfcsize | internal_date       |
+------+-------------+---------+---------------------+
| 1000 |        2164 |    2226 | 2003-07-12 09:13:57 |
+------+-------------+---------+---------------------+
1 row in set (0.00 sec)


mysql> select * from dbmail_partlists where physmessage_id=1000;
Empty set (0.00 sec)


The constraints are set such that the dbmail_phymessage row would need 
to be deleted to cascade a delete in the dbmail_messageblks. So simply 
inserting the unique parts in the mimeparts, then insert the part_id's 
into partlists, update header cache, then delete the messageblks. All 
sounds simple enough. Essentially a retrieve piped to insert loop.

I think that it should just do all messages. Perhaps an option to do x 
number of messages per run. Free disk space could be a concern on some 
database servers. In the case of a MySQL INNODB setup, inserting all the 
messages would take up more space in the mimeparts table while the 
messageblks would no be shrinking on the disk until it was optimized or 
dropped. Database or server load could also cause issues with just 
leaving the convert process running to chomp on 10,000+ messages.

-Jon




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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

Reply via email to