I have several transactional tables that has a logically-placed text and a blob column in MySQL. After a period of time these data columns are not needed on rows older than X days. I need to be as storage-aware as possible. This is on multiple nodes in a cluster that have limited local and NFS storage, so keeping them as files not viable.
Two obvious solutions, which is the better (if any) way of ensuring freed blob table storage:
- On some schedule, update all the rows where date < X days ago set the text and blob columns to null. Does this actually free the blob data storage in the "hidden" table?
- Keep these blobs in a separate table and then delete from the table where date < X days ago.
Keeping in good schema form, I don't want to have a blob-table per transaction table as to keep the transaction keys independent, and I don't want to have associative/smart/compound keys in a single blob table.
What mechanism works best for temporal blob storage in MySQL?