> 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 menyimpan titik pelacakan, input, status, dan peristiwa yang dikirim oleh perangkat. Telusuri definisi skema dan deskripsi tabel utama untuk analisis SQL

Ini **`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 %}

Temukan detail skema data telematika mentah di bawah ini.

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

```sql
Tabel 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)}

}

  

Tabel 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)}

}

  

Tabel 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)}

}

  

Tabel 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 aspek-aspek berbeda dari informasi perangkat:

<details>

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

**Tujuan**: Data lokasi dan gerakan inti

<table><thead><tr><th width="181.20001220703125">Atribut</th><th>Rincian</th></tr></thead><tbody><tr><td><strong>Kolom kunci</strong></td><td><code>device_id</code>, <code>device_time</code>, <code>platform_time</code>, <code>latitude</code>, <code>longitude</code>, <code>Kecepatan</code>, <code>Ketinggian</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\n\nKecepatan juga disimpan dalam integer, jadi Anda perlu membaginya dengan 100</td></tr></tbody></table>

</details>

<details>

<summary><code>inputs</code></summary>

**Tujuan**: Pembacaan sensor dari perangkat

<table><thead><tr><th width="182">Atribut</th><th>Rincian</th></tr></thead><tbody><tr><td><strong>Kolom 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 yang dihitung (RPM mesin)</td></tr><tr><td><strong>Relasi</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 operasional

<table><thead><tr><th width="174.800048828125">Atribut</th><th>Rincian</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, diam, 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**: Status sinyal input/output diskret dan data perangkat nonstandar lainnya

<table><thead><tr><th width="174.800048828125">Atribut</th><th>Rincian</th></tr></thead><tbody><tr><td><strong>Kolom 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> adalah string bit dengan satu karakter untuk setiap saluran 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 masa depan dan saat ini belum terisi. Tabel ini menjadi sumber untuk <code>processed_common_data.input_change_events</code>. Lihat <a href="/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 detik). Skema ini dioptimalkan untuk data deret waktu menggunakan TimescaleDB untuk penyimpanan dan pengambilan yang efisien.

## Informasi tambahan

### Validasi data

Basis data menegakkan integritas data melalui beberapa mekanisme:

* **kendala CHECK** memvalidasi bahwa nilai berada dalam rentang yang dapat diterima
* **kunci asing** memastikan hubungan antar tabel tetap konsisten
* **kendala NOT NULL** menjamin bahwa bidang yang diperlukan selalu memiliki nilai
* **nilai DEFAULT** menyediakan nilai cadangan saat data tidak diberikan secara eksplisit

### Optimasi kueri

Tabel diatur dengan strategi pengindeksan khusus:

* Semua tabel menyertakan **indeks berbasis waktu** aktif `record_added_at`
* Kolom kunci asing memiliki indeks khusus untuk performa 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
