I'm working on an email support system. Each stored email contains from_email
, subject
, date
, some flags, and the contents
of the mail. Clearly, the amount of mail can be large, and our system is mainly focused on the most recent messages (for instance, the last 14 days) and the older ones are considered archived. We do also want to search, filter on some tags, and so on.
For list views of the emails, we do not need to consider the content
field. I am considering two options, all data in one table, and a seperate table which stores the LONGTEXT
email bodies.
Assuming that the SQL SELECT
fields does not contain the content
field, is it more efficient to have it in a seperate table?. Clearly, the LONGTEXT
field is not stored with the fixed-length row data, but I imagine it could be interleaved, so that the number of pages that must be fetched for a list view is larger.
I'm using MariaDB 5.5.25 and the InnoDB engine.