We had some parsing issues in the past which resulted in wrong positions being added to the database. Now I would like to remove those positions to fix the statistics calculation (e.g. total distance) for the affected devices.
What do I have to consider when removing rows from the tc_positions table?
I was thinking something like this:
DELETE FROM tc_positions
WHERE fixtime < '2017'
AND id NOT IN
(SELECT positionId
FROM tc_devices
WHERE positionId IS NOT NULL);
If positions were in the past, they should not affect distance calculation.
How is total distance calculated than?
It is accumulated only based on last known location. If you have locations older than the current latest one, those will not affect total distance.
We had some parsing issues in the past which resulted in wrong positions being added to the database. Now I would like to remove those positions to fix the statistics calculation (e.g. total distance) for the affected devices.
What do I have to consider when removing rows from the tc_positions table?
I was thinking something like this:
DELETE FROM tc_positions WHERE fixtime < '2017' AND id NOT IN (SELECT positionId FROM tc_devices WHERE positionId IS NOT NULL);