# Range index

Range indexing allows you to get better performance for queries that involve filtering over a range.

It would be useful for a query like the following:

```sql
SELECT COUNT(*) 
FROM baseballStats 
WHERE hits > 11
```

A range index is a variant of an [inverted index](/release-1.1.0/basics/indexing/inverted-index.md), where instead of creating a mapping from values to columns, we create mapping of a range of values to columns. You can use the range index by setting the following config in the [table configuration](/release-1.1.0/configuration-reference/table.md).

```javascript
{
    "tableIndexConfig": {
        "rangeIndexColumns": [
            "column_name",
            ...
        ],
        ...
    }
}
```

Range index is supported for both dictionary and raw-encoded columns.

{% hint style="info" %}
A good thumb rule is to use a range index when you want to apply range predicates on metric columns that have a very large number of unique values. This is because using an inverted index for such columns will create a very large index that is inefficient in terms of storage and performance.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.pinot.apache.org/release-1.1.0/basics/indexing/range-index.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
