I have a table in MariaDB (version 10.3 or later) that stores sent emails. One of the fields is body, of type LONGTEXT, which contains the full HTML content of the email.
This table is growing quite large, and the time to perform backups (dumps) has also increased significantly.
I ran a test using the COMPRESS() function on the content before storing it, and here are the results:
Table size reduced: 4.7x smaller
Dump time reduced: 5x faster
My question is: Is storing the email body compressed using COMPRESS() considered a good practice in this scenario? Are there any important downsides or better alternatives (e.g., moving this field to a separate table, storing the content externally, etc.)?
Additional info:
The body field is not used in searches (no LIKE or FULLTEXT)
Read access is rare, mostly for historical logs
Using MariaDB 10.3 or later
I’d appreciate any insights or suggestions for better handling large tables with rarely accessed data.