I have an unusual situation regarding DB table splitting; I have a table named 'message' holding info for messages to be sent via email:
Message Status
-------------------------------- -------------
id | subject | body | status_id status_id | caption
-------------------------------- ----------------------
1 random bla 3 1 draft
2 second hello 3 2 scheduled
15 subj ok 1 3 archived
When message is created, it's status is automatically set to draft
, it can be scheduled
, and finally, when sent to at least one contact, it's status is archived
.
My boss suggests that messages should be split in three tables
named
draft,
scheduled and
archived.
In practice, almost everytime you search for message
in DB for sending (status is 'draft')
, the table contains large amount of unneeded data (messages with status 'archived'). But, if I split the table, everytime I change the status of a message, I have to insert it to the corresponding table, and delete
from current status
table.
Since I haven't heard of such a practice before, I ask for an opinion. Is it valid to split
the tables? Thanks in advance