old position delete

Niraj Singh2 years ago

Hi,

We have setup history position delete as per mentioned in this link https://www.traccar.org/clear-history/.

when the daily job is running our server is getting hanged and our positions records to be deleted are around 4 millions.Even we have checked job is deleting the position records but our harddisk available space is not increasing.We are usign mysql database.

any suggestion how to delete those position data without effecting server performance?

Thanks

Anton Tananaev2 years ago

Have you created the indexes?

The available disk space won't increase after you remove the data, but internally MySQL will have some extra space in the existing file.

Niraj Singh2 years ago

yes we have created indexes in both position and event tables.Any idea how much time it will take to delete 4 millions records?

Anton Tananaev2 years ago

It will take a long time, but the whole point of the script is that it doesn't block the database for a long time.

Hello, we use SQLserver2019 and we need to keep only the last 90 days. Is there a script that deletes, every night only 1 day without blocking the server?
Does the elimination operation use many RAM or processor resources?
Thank you

Anton Tananaeva year ago

We don't have a ready script for MS SQL Server and Windows. But you can look at the documentation for MySQL and do something similar.