Christian G. Warden wrote:


A database can perform well at easier tasks too.  In my experience,
dbmail is already faster at updating a large folder than uw-imapd with
mbox.  Ilja's recent changes make copying messages very fast.  If we
index some of the headers, we can also get improved performance on
server-side searching.


Today, we deliver all the mail data to the messageblock table.
What about delivering the headers to a "header" table and the rest of the message to the messageblock.

Suppose we have something like
CREATE TABLE headerblks (
        headerblk_idnr bigint(21) NOT NULL auto_increment,
        physmessage_id bigint(21) NOT NULL default '0',
        headerblk longtext NOT NULL,
        blocksize bigint(21) NOT NULL default '0',
        PRIMARY KEY  (headerblk_idnr),
        KEY physmsg_index (physmessage_id),
        FOREIGN KEY (`physmessage_id`) REFERENCES
                `physmessage`(`id`) ON DELETE CASCADE,
===> FULLTEXT (headerblk)
        ) TYPE=InnoDB;
The above is a copy of the messageblks structure, with the string "messageblk" changed to "headerblk" and a FULLTEXT index on the headerblk. This way, we can search for all kind of headers with a simple SQL statement, and actually not do that much of coding ourself.

This will also make it easier to only store exactly one instance of each messageblock, as has been diskussed yesterday.

/Magnus



Reply via email to