Hello,
I'm using traccar with forward url, so all data is saved in an external db, and I'm using the api to send gprs commands to connected devices.
I think I need to have the last known position in the traccar database (mySQL) to be able to execute gprs commands via api, is this assumption correct?
If correct, is it possible to tell traccar to keep only the last position in tc_positions for each devices?
Motivation: I'm having 40M positions inserted daily into tc_positions and I was trying to keep only 1 day of history, tried the clear procedure but it's very slow (takes hours).
Thank you
You can have a script that removes all positions except the ones that are referenced from the devices table.
Thanks,
something like
delete from tc_positions where id not in (select positionid from tc_devices);
I run this query with limit 1000 where tc_positions contains 69700493 records but it was very very slow to a point I interrupted its execution.
Thanks
It's going to be slow when you have a lot of data, but eventually it should run quickly. Just make sure you run it frequently.
Hello,
I'm using traccar with forward url, so all data is saved in an external db, and I'm using the api to send gprs commands to connected devices.
I think I need to have the last known position in the traccar database (mySQL) to be able to execute gprs commands via api, is this assumption correct?
If correct, is it possible to tell traccar to keep only the last position in tc_positions for each devices?
Motivation: I'm having 40M positions inserted daily into tc_positions and I was trying to keep only 1 day of history, tried the clear procedure but it's very slow (takes hours).
Thank you