> For the complete documentation index, see [llms.txt](https://docs.marpledata.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.marpledata.com/docs/marple-insight/setup-and-configuration/data-connection/supported-databases/marple-db/setup-segments.md).

# Setup segments

If your datasets contain a signal that represents segment information, you can visualize those segments directly in Insight.&#x20;

{% hint style="warning" %}
Segment support is still under development, so the configuration requires a small amount of technical setup. More options and improved usability will be added over time.
{% endhint %}

Follow the guidelines below to enable segment visualization today.

#### 1. Configure the "List segments" Query

1. Go to **Settings → Connection**.
2. In the **Queries** tab, verify that the **List segments** query is available.
   * If the query is missing, download and import the latest `connection.json` from **Marple DB** to update your queries.\
     ![](/files/AdZNyNXgsXtlvuK1TnmO)
3. Paste the following query into the **List segments** query field:

```
select
  value as id,
  value as label,
  min(time) as start,
  max(time) as stop
from mdb_default_data({{ dataset.dataset }}, {{ segment_id | int }})
group by value, label
```

#### 2. Define the `segment_id` variable

To tell Insight which signal represents your segments, create a constant variable:

1. At the top of the **Queries** tab, add a new variable named **segment\_id**.
2. The value of this constant must be the **internal ID** of the segment signal in Marple DB.

<figure><img src="/files/GOcKvVJFt9Pt0Jxz6ovV" alt=""><figcaption></figcaption></figure>

To find this ID:

1. Open a dataset in **Marple DB** that contains the segment signal.
2. Go to the **Signals** tab.
3. Locate the signal you want to use as the segment signal.
4. Copy the value from the **ID** column.
5. Paste this value as the constant’s value for `segment_id`.\
   ![](/files/5hhZFKJuCnzb5yTMU1Su)

#### 3. Configure Segment Metadata (Optional)

In the **Metadata** section at the bottom of the Queries tab, you can fine-tune how segments appear in the Insight interface.

Available options:

* **Segment alias**\
  Choose how segments are labeled in Insight (e.g., “Lap”).
* **Highlight fastest segment**\
  When enabled, Insight highlights the fastest segment in purple in the segment overview.

<figure><img src="/files/pI2AvCSkFPwBFdJmDgph" alt=""><figcaption></figcaption></figure>
