In our setup the Email table size is around 20 GB, I need query to delete the emails from the table which are 3 years old.
Hi Raja H,
a SQL Query like this should work (you need to adjust the timestamp to the date you want)
update emails set deleted = 1 where date(date_entered) <= '2015-01-01 00:00:00';
This will mark the email record as deleted and your cronjob (Prune Database on 1st of Month) will delete all related database entries that are tied to the email automatically on the next run:
DO NOT RUN QUERIES LIKE THIS WITHOUT TESTING! ALSO DO A BACKUP BEFORE RUNNING UPDATE OR DELETE STATEMENTS!
Thank you, I will check and update in Development DB and then I will do it in Production DB.
Retrieving data ...