Lic. Martin Marques wrote:
What does the messages table exactly store? I'm looking at it's contents and it looks like it puts there good part of the mail headers, plus some other information.
This table is used to store message headers locally for caching purpose. It will only be used if caching is enabled which is not necessary if the IMAP server runs on the same machine.
I'm not sure yet, how to keep this table clean to avoid an exhausting amount of cached messages here. One possibility is to store the message headers just for the current session and remove them when logging out. But for performance issues it would be better to keep the cached messages over multiple sessions...
Other thought was to add a last_view_date which could allow a garbage collection routine to remove headers that haven't been listed over a certain amount of time. The disadvantage of this behavior would be that on every view (SELECT from DB) the last_view_date has to be updated what will cause the database to rewrite it's index and make it slower again.
I'm curious, what you guys think of that problem? Anybody out there experienced with caching mechanisms?
Regards, Thomas