Write positions to separate database tables for each device

Andrii Hondaa year 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 Tananaeva year ago

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

Elnaza month ago

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

Anton Tananaeva month ago

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

Elnaza month ago

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

Anton Tananaeva month ago

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