From: "Aaron Stone" <[EMAIL PROTECTED]> > The reason for a new headers table is not so that the headers are taken > out of the messageblks table, but rather because we want some of those > headers to be pulled out and stored in columns of their own. > > The new table would have just a messageid and a few columns named after > the most often used headers. I would expect these all to be indexed, btw. > The actual header itself *should* be stored verbatim and intact as a > chunk of the message, but a "fastheaders" table that holds From, To, > Subject, Date and few others will dramatically speed up many simple IMAP > listing operations as well as your most common searches.
Again, I don't think we should have columns specific to particular headers, I think it would be better to have a more generic structure for the message_headers table like: id serial primary key header text (possibly an int referencing a lookup table of headers) header_value text (contains the value of the header) Index both of these columns and it will be quite fast. By default we would probably only add typical columns such as To, From, Subject, Date etc... but this allows things to be added as needed. If a particular site / user / mailbox / folder needs to search on a non default header (size for example) then the server can be configured to track this information without needing to change database structure.
