> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/analytics/id/iot-query/schema-overview/bronze-layer/raw-telematics-data.md).

# Skema raw\_telematics\_data

raw\_telematics\_data memuat titik pelacakan, input, status, dan peristiwa yang dikirim oleh perangkat. Telusuri definisi skema dan deskripsi tabel utama untuk analisis SQL

Itu **`raw_telematics_data`** Skema ini berisi empat jenis tabel utama yang bekerja bersama untuk menyediakan data perangkat yang komprehensif.

{% hint style="info" %}
Diagram interaktif skema raw\_telematics\_data tersedia di **dbdiagram.io**: <https://dbdiagram.io/d/v1-schema-telematics-bd-67a0acef263d6cf9a0d8e750>
{% endhint %}

Rincian skema data telematika mentah tersedia di bawah.

{% code title="Skema raw\_telematics\_data" expandable="true" %}

```sql
Table tracking_data_core {

  device_id integer [primary key]

  device_time timestampz [primary key]

  platform_time timestampz

  record_added_at timestampz [default: `now()`]

  latitude integer

  longitude integer

  speed integer

  altitude integer

  satellites integer

  event_id integer

  gps_fix_type integer

  hdop integer

  

  indexes {(device_id, device_time)}

}

  

Table inputs {

  event_id integer [primary key]

  device_id integer [primary key]

  record_added_at timestampz [default: `now()`]

  device_time timestampz [primary key]

  sensor_name text [primary key]

  value text

  indexes {(device_id, device_time)}

}

  

Table states {

  event_id integer [primary key]

  device_id serial [primary key]

  record_added_at timestampz [default: `now()`]

  device_time timestampz [primary key]

  state_name text [primary key]

  value text

  indexes {(device_id, device_time)}

}

  

Table additional_data {

  device_id integer [primary key]

  device_time timestampz [primary key]

  platform_time timestampz

  record_added_at timestampz [default: `now()`]

  discrete_inputs text [primary key]

  discrete_outputs text [primary key]

  special_jsonb jsonb

  indexes {(device_id, discrete_inputs, discrete_outputs, device_time)}

}

 

Ref: inputs.(device_id, device_time) > tracking_data_core.(device_id, device_time)

Ref: states.(device_id, device_time) > tracking_data_core.(device_id, device_time)

Ref: additional_data.(device_id, device_time) > tracking_data_core.(device_id, device_time)
```

{% endcode %}

## Tabel utama berdasarkan kategori

Setiap tabel memiliki tujuan spesifik dalam menangkap berbagai aspek informasi perangkat:

<details>

<summary><code>tracking_data_core</code></summary>

**Tujuan**: Data inti lokasi dan pergerakan

<table><thead><tr><th width="181.20001220703125">Atribut</th><th>Detail</th></tr></thead><tbody><tr><td><strong>Bidang kunci</strong></td><td><code>device_id</code>, <code>device_time</code>, <code>platform_time</code>, <code>lintang</code>, <code>bujur</code>, <code>speed</code>, <code>altitude</code>, <code>satellites</code>, <code>hdop</code>, <code>event_id</code></td></tr><tr><td><strong>Pengindeksan</strong></td><td>Dioptimalkan dengan indeks pada (<code>device_id</code>, <code>device_time</code>)</td></tr><tr><td><strong>Catatan khusus</strong></td><td>Data lokasi (lintang dan bujur) menggunakan format integer dengan presisi 10⁷ untuk performa TimescaleDB yang optimal<br><br>Kecepatan juga disimpan dalam integer, jadi Anda perlu membaginya dengan 100</td></tr></tbody></table>

</details>

<details>

<summary><code>input</code></summary>

**Tujuan**: Pembacaan sensor dari perangkat

<table><thead><tr><th width="182">Atribut</th><th>Detail</th></tr></thead><tbody><tr><td><strong>Bidang kunci</strong></td><td><code>input_id</code>, <code>device_id</code>, <code>device_time</code>, <code>sensor_name</code>, <code>nilai</code></td></tr><tr><td><strong>Konten</strong></td><td>Pembacaan analog (level bahan bakar, suhu, tegangan), nilai hasil perhitungan (RPM mesin)</td></tr><tr><td><strong>Hubungan</strong></td><td><pre data-overflow="wrap"><code>FROM raw_telematics_data.inputs AS i
JOIN raw_business_data.sensor_description AS sd
    ON i.device_id = sd.device_id AND i.sensor_name = sd.input_label
JOIN raw_telematics_data.tracking_data_core AS tdc
    ON i.device_id = tdc.device_id AND i.device_time = tdc.device_time
</code></pre></td></tr></tbody></table>

</details>

<details>

<summary><code>states</code></summary>

**Tujuan**: Indikator status perangkat dan mode operasi

<table><thead><tr><th width="174.800048828125">Atribut</th><th>Detail</th></tr></thead><tbody><tr><td><strong>Bidang kunci</strong></td><td><code>state_id</code>, <code>device_id</code>, <code>device_time</code>, <code>state_name</code>, <code>nilai</code></td></tr><tr><td><strong>Konten</strong></td><td>Indikator mode operasi (bekerja, menganggur, mati), status komponen (pengapian, pintu)</td></tr><tr><td><strong>Format nilai</strong></td><td>Nilai Boolean (1/0) atau kode status tertentu</td></tr></tbody></table>

</details>

<details>

<summary><code>additional_data</code></summary>

**Tujuan**: Keadaan sinyal input/output diskret dan data perangkat nonstandar lainnya

<table><thead><tr><th width="174.800048828125">Atribut</th><th>Detail</th></tr></thead><tbody><tr><td><strong>Bidang kunci</strong></td><td><code>device_id</code>, <code>device_time</code>, <code>platform_time</code>, <code>discrete_inputs</code>, <code>discrete_outputs</code></td></tr><tr><td><strong>Kunci utama</strong></td><td>Komposit: <code>(device_id, discrete_inputs, discrete_outputs, device_time)</code></td></tr><tr><td><strong>Konten</strong></td><td>Masing-masing dari <code>discrete_inputs</code> dan <code>discrete_outputs</code> merupakan string bit dengan satu karakter untuk setiap kanal input atau output (misalnya, <code>"10110001"</code>), di mana <code>1</code> berarti aktif dan <code>0</code> berarti nonaktif</td></tr><tr><td><strong>Catatan khusus</strong></td><td><code>special_jsonb</code> adalah kolom cadangan untuk data perangkat di masa mendatang dan saat ini belum terisi. Tabel ini memasok <code>processed_common_data.input_change_events</code>. Lihat <a href="https://navixy.com/docs/analytics/id/iot-query/schema-overview/transformation-layer/common-transformations/input-change-events.md">Peristiwa perubahan input</a></td></tr></tbody></table>

</details>

Data dalam skema ini diingest langsung dari perangkat, dengan latensi minimal (biasanya beberapa detik). Skema ini dioptimalkan untuk data deret waktu dengan menggunakan TimescaleDB agar penyimpanan dan pengambilan lebih efisien.

## Informasi tambahan

### Validasi data

Basis data menegakkan integritas data melalui beberapa mekanisme:

* **Batasan CHECK** memvalidasi bahwa nilai berada dalam rentang yang dapat diterima
* **Kunci asing** memastikan hubungan antartabel tetap konsisten
* **Batasan NOT NULL** menjamin bahwa bidang yang wajib selalu memiliki nilai
* **Nilai DEFAULT** menyediakan nilai cadangan ketika data tidak diberikan secara eksplisit

### Optimasi kueri

Tabel diorganisasikan dengan strategi pengindeksan tertentu:

* Semua tabel mencakup **indeks berbasis waktu** on `record_added_at`
* Kolom kunci asing memiliki indeks khusus untuk kinerja join
* Kombinasi kolom yang sering digunakan memiliki **indeks komposit**
* TimescaleDB menyediakan indeks khusus untuk kueri deret waktu


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://navixy.com/docs/analytics/id/iot-query/schema-overview/bronze-layer/raw-telematics-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
