> ## Documentation Index
> Fetch the complete documentation index at: https://docs.textql.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Metrics

> Mark attributes as measures or dimensions to optimize query performance

When setting up an object, you can mark specific attributes as **Measures** or **Dimensions** to enhance query efficiency and help Ana understand your data model better.

* **Measures** - Numeric columns that contain quantitative data to be aggregated. For example, `total_revenue`, `order_count`, `average_rating`

* **Dimensions** - Categorical columns used to slice, filter, or group data. For example, `region_name`, `customer_age_group`, `product_category`

## Marking Attributes

To mark attributes as measures or dimensions:

1. Click on an object to open the Object Sidebar
2. Go to the "Attributes" tab
3. Click the **"meas"** button next to an attribute to mark it as a measure
4. Click the **"dim"** button next to an attribute to mark it as a dimension
5. Changes are saved automatically

The buttons are highlighted when active.

## Benefits of Defining Metrics and Dimensions

Specifying metrics and dimensions improves the performance and usability of queries by enabling faster identification of relevant data areas.

For instance, if a user asks, "Split total orders by region and plot on a map," Ana can quickly identify:

* `total_orders` as the measure to aggregate
* `region_name` as the dimension to group by

When metrics and dimensions are pre-defined, query performance improves significantly, particularly for large datasets.

## Best Practices for Large Datasets

For datasets with over 10 million rows, defining metrics and dimensions is strongly recommended. This approach:

* Increases the reliability of Ana
* Reduces message latency
* Allows Ana to load more data efficiently into the Python sandbox

By structuring datasets with clear metrics and dimensions, you can streamline data exploration and enhance the overall query experience.
