Can we Truncate the positions Table directly?

Nikhil6 years ago

We have the configuration deployed for production and running for almost 4 months. We just require the previous 1 month data for reports. So, can we directly go ahead and delete the data from the positions table directly which is old and we don't require. Will this cause some issue on the server or not? As deleting data will make the positions api to run faster.

Anton Tananaev6 years ago

Here are the Linux commands I use to truncate old data:

/opt/traccar/bin/stopDaemon.sh
mysqldump --skip-lock-tables -t -u root -p traccar positions --where="id IN (SELECT positionid FROM devices)" > positions.sql
mysql -u root -p traccar --execute="TRUNCATE positions"
mysql -u root -p traccar --execute="TRUNCATE events"
mysql -u root -p traccar < positions.sql
rm positions.sql
/opt/traccar/bin/startDaemon.sh

Hola, Anton. buenas noches.

Sigue siendo esto valido para la version de traccar 4.14 en debian 11 con MariaDB?

Anton Tananaev2 years ago

Не понял.

Hello, Anton. Good night.

Is this still valid for the version of traccar 4.14 on debian 11 with MariaDB?

Anton Tananaev2 years ago

It's outdated. You need to change table names. Add tc_.