Hi,
My Traccar database has grown significantly (over 10GB), mainly due to the tc_positions table. I need to free up disk space by deleting old history manually.
What is the safest and most efficient SQL query to delete all positions older than 6 months (180 days) while keeping the recent data intact?
Thanks.
delete from tc_positions where servertime < DATE(NOW() - INTERVAL 180 day);
Doing it as a single query is a really bad idea. It will block table for a long time.
Hi,
My Traccar database has grown significantly (over 10GB), mainly due to the tc_positions table. I need to free up disk space by deleting old history manually.
What is the safest and most efficient SQL query to delete all positions older than 6 months (180 days) while keeping the recent data intact?
Thanks.