> 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/connection-configuration/optional-queries.md).

# Optional Queries

## Segment List Query

The **Segment List** query retrieves all segments within a given dataset.

### **Input Parameter**

Your query should support the following:

* **`dataset`** *(Required)* – A key-value pair for each metadata key checked in the dataset filter. Used in queries as `{{ dataset.id }}`.

### **Expected Output**

Each segment should be represented as a row containing:

* **`id`** *(Required)* – The unique identifier of the segment.
* **`label`** *(Required)* – A descriptive label for the segment.
* **`start`** *(Required)* – The timestamp of the first data point in the segment in nanoseconds.
* **`stop`** *(Required)* – The timestamp of the last data point in the segment in nanoseconds.
* **Additional metadata fields** *(Optional)* – Any relevant metadata attributes.

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

## Other Optional Queries

In addition to the core queries, Marple supports several optional queries for improved performance and functionality:

* **Time Series Batch** – Retrieves data for multiple signals within a time range, with optional subsampling.
* **Cursor Values** – Fetches signal values at a specific timestamp, useful for scatter plots and maps.
* **Cursor Statistics** – Computes min, max, and mean values within a time range.
* **Signal Table** – Joins multiple signals into a single table with a common timestamp column.
* **Sandbox Signal** – Derives a new signal from existing ones using a formula.
* **Sandbox Preview** – Previews the results of a derived signal before applying it.

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