Write positions to separate database tables for each device

Andrii Honda2 years ago

Hi. I want to write positions to separated tables in PostgreSQL database by next structure: for each device, create a table with name like device_positions_{deviceid} and with structure similar to tc_positions. I think it is a better way for storing large amount of data in database.
Can I configure Traccar to store positions by this way using configuration file?

Hi, i think you can use the table partition feature of postgres.
For date series data it is a good idea to partition table by range not by device, but it is up to you.
I think this is not related to traccar software, it is a feature you need to configure in the database

Anton Tananaev2 years ago

Partitioning is what you should do instead of reinventing the wheel.

Elnaz3 months ago

I know how to partition tables in database, now I'd like to know if Traccar offers any configurations for table partitioning.

Anton Tananaev3 months ago

What do you mean? What kind of configuration are you looking for?

Elnaz3 months ago

A configuration for creating tables by partition, i mean when traccar restarts tables(like positions) create by partition.

Anton Tananaev3 months ago

No, there's no such option. Partitioning is very database specific, so there's no generic solution that Traccar can implement.