Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

raw_telematics_data schema

raw_telematics_data holds tracking points, inputs, states, and events sent by devices. Browse the schema definition and key table descriptions for SQL analysis

The raw_telematics_data schema contains four primary table types that work together to provide comprehensive device data.

The interactive diagram of raw_telematics_data schema is available on dbdiagram.io: https://dbdiagram.io/d/v1-schema-telematics-bd-67a0acef263d6cf9a0d8e750

Find raw telematics data schema details below.

Key tables by category

Each table serves a specific purpose in capturing different aspects of device information:

tracking_data_core

Purpose: Core location and motion data

Attribute
Details

Key fields

device_id, device_time, platform_time, latitude, longitude, speed, altitude, satellites, hdop, event_id

Indexing

Optimized with index on (device_id, device_time)

Special notes

Location data (latitude and longitude) uses integer format with 10⁷ precision for optimal TimescaleDB performance Speed is also stored in integer, so you need to divide it with 100

inputs

Purpose: Sensor readings from devices

Attribute
Details

Key fields

input_id, device_id, device_time, sensor_name, value

Content

Analog readings (fuel level, temperature, voltage), calculated values (engine RPM)

Relationships

states

Purpose: Device status indicators and operational modes

Attribute
Details

Key Fields

state_id, device_id, device_time, state_name, value

Content

Operating mode indicators (working, idle, off), component statuses (ignition, doors)

Value Format

Boolean values (1/0) or specific status codes

additional_data

Purpose: Discrete input/output signal states and other non-standard device data

Attribute
Details

Key fields

device_id, device_time, platform_time, discrete_inputs, discrete_outputs

Primary key

Composite: (device_id, discrete_inputs, discrete_outputs, device_time)

Content

Each of discrete_inputs and discrete_outputs is a bit string with one character per input or output channel (for example, "10110001"), where 1 means on and 0 means off

Special notes

special_jsonb is a reserved column for future device data and isn't currently populated. This table feeds processed_common_data.input_change_events. See Input change events

Data in this schema is ingested directly from devices, with minimal latency (typically seconds). The schema is optimized for time-series data using TimescaleDB for efficient storage and retrieval.

Additional information

Data validation

The database enforces data integrity through multiple mechanisms:

  • CHECK constraints validate that values fall within acceptable ranges

  • Foreign keys ensure relationships between tables remain consistent

  • NOT NULL constraints guarantee that required fields always have values

  • DEFAULT values provide fallback when data isn't explicitly provided

Query optimization

Tables are organized with specific indexing strategies:

  • All tables include time-based indexes on record_added_at

  • Foreign key columns have dedicated indexes for join performance

  • Frequently used column combinations have composite indexes

  • TimescaleDB provides specialized indexes for time-series queries

Last updated

Was this helpful?