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

# Top Ranges Page

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

<Note>
  On a secure cluster, this area of the DB Console can only be accessed by users belonging to the <InternalLink path="security-reference/authorization#admin-role">`admin` role</InternalLink> or a SQL user with the <InternalLink path="security-reference/authorization">`VIEWCLUSTERMETADATA`</InternalLink> <InternalLink path="security-reference/authorization#supported-privileges">system privilege</InternalLink> (or the legacy `VIEWACTIVITY` or `VIEWACTIVITYREDACTED` <InternalLink path="security-reference/authorization">role option</InternalLink>) defined. The <InternalLink path="security-reference/authorization">`VIEWACTIVITY`</InternalLink> or <InternalLink path="security-reference/authorization">`VIEWACTIVITYREDACTED`</InternalLink> <InternalLink path="security-reference/authorization#supported-privileges">system privileges</InternalLink> **do not** grant access to this page.
</Note>

The **Top Ranges** page of the DB Console provides details about the highest-ranked ranges by metrics such as reads, writes, queries per second (QPS), and CPU. Ranges that rank highly by these measures may indicate <InternalLink path="understand-hotspots#hot-range">*hot ranges*</InternalLink>, but are not necessarily problematic.

When optimizing or troubleshooting statement performance, this page can help you identify nodes, ranges, or tables that are experiencing <InternalLink path="understand-hotspots">hotspots</InternalLink>.

To view this page, <InternalLink path="ui-overview#db-console-access">access the DB Console</InternalLink> and click **Top Ranges** in the left-hand navigation.

## Select nodes

In the **Select Nodes** filter, choose one or more nodes with high activity, such as high CPU usage, to investigate potential hotspots. Selecting fewer nodes can help identify the hottest ranges more quickly and improve page load time.

Selecting a region, such as `us-east1`, selects all nodes in that region.

In the **Select Nodes** search box, enter numbers to search for specific node IDs. For example, in a cluster with 12 nodes, entering `1` returns checkboxes for node IDs `n1`, `n10`, `n11`, and `n12`.

Click **Apply** to view the [top ranges list](#top-ranges-list) for the selected nodes.

## Filter top ranges

After [selecting nodes](#select-nodes), use the **Filter** menu to filter the [top ranges list](#top-ranges-list). You can choose to view top ranges across a specific table, index, store ID, and one or more databases.

In the **Databases** dropdown list, you can choose to filter by specific databases (optional).

In the **Table** and **Index** search boxes, enter the complete name of a table or index to return results. For example, in the <InternalLink path="movr">`movr` database</InternalLink>, search for the exact index name `users_pkey` to return results. Entering a partial index name, such as `user` or `users` returns no results.

In the **Store ID** search box, enter numbers to search for specific store IDs. For example, in a cluster with 12 stores, entering `1` returns results for store IDs `1`, `10`, `11`, and `12`.

Click **Apply** to view the filtered [top ranges list](#top-ranges-list).

## Top ranges list

The **Top ranges** list displays the ranges with the highest queries per second (QPS) from each node <InternalLink path="architecture/storage-layer">`store`</InternalLink>.

<Note>
  Top ranges are not necessarily problematic. Some ranges naturally experience higher QPS than others. For example, a range for a frequently accessed table will have a higher QPS.

  However, a significant increase in traffic can also indicate a *hotspot* on the range that should be reduced. For more information, refer to <InternalLink path="understand-hotspots#hot-range">Understand hotspots</InternalLink>.
</Note>

To view the [Range Report](#range-report) for a top range, click its range ID.

| Parameter     | Description                                                                                                                                                                                                                                                                                                                                                |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Range ID      | The ID of the top range. Click the range ID to view the [Range Report](#range-report) for this range.                                                                                                                                                                                                                                                      |
| QPS           | The total number of <InternalLink path="selection-queries">`SELECT`</InternalLink>, <InternalLink path="update">`UPDATE`</InternalLink>, <InternalLink path="insert">`INSERT`</InternalLink>, and <InternalLink path="delete">`DELETE`</InternalLink> queries executed per second on this range. The per-second rate is averaged over the last 30 minutes. |
| CPU           | The total CPU time per second used in processing this range. The per-second rate is averaged over the last 30 minutes.                                                                                                                                                                                                                                     |
| Write (keys)  | The total number of keys written per second on this range. The per-second rate is averaged over the last 30 minutes.                                                                                                                                                                                                                                       |
| Write (bytes) | The total number of bytes written per second on this range. The per-second rate is averaged over the last 30 minutes.                                                                                                                                                                                                                                      |
| Read (keys)   | The total number of bytes written per second on this range. The per-second rate is averaged over the last 30 minutes.                                                                                                                                                                                                                                      |
| Read (bytes)  | The total number of bytes read per second on this range. The per-second rate is averaged over the last 30 minutes.                                                                                                                                                                                                                                         |
| Nodes         | The ID of each node where the range data is found.                                                                                                                                                                                                                                                                                                         |
| Store ID      | The ID of the store where the range data is found.                                                                                                                                                                                                                                                                                                         |
| Leaseholder   | The ID of the node that has the <InternalLink path="architecture/reads-and-writes-overview#cockroachdb-architecture-terms">range lease</InternalLink>.                                                                                                                                                                                                     |
| Database      | The database where the range data is found.                                                                                                                                                                                                                                                                                                                |
| Table         | The table where the range data is found.                                                                                                                                                                                                                                                                                                                   |
| Index         | The index where the range data is indexed, if applicable.                                                                                                                                                                                                                                                                                                  |
| Locality      | The locality of the node where the range data is found.                                                                                                                                                                                                                                                                                                    |

## Range Report

The **Range Report** is typically used for <InternalLink path="ui-debug-pages#even-more-advanced-debugging">advanced debugging</InternalLink> purposes.

If your aim is to <InternalLink path="understand-hotspots#reduce-hotspots">reduce hotspots</InternalLink>, refer to the following fields:

* `Key Range` shows the interval of the <InternalLink path="architecture/distribution-layer#range-descriptors">key space</InternalLink> that is "hottest" (i.e., read by the processor). This is expressed as a span of key values.
* `Lease Holder QPS` shows the queries executed per second on the node that holds the <InternalLink path="architecture/replication-layer#leases">range lease</InternalLink>. If a top range is not properly using <InternalLink path="load-based-splitting">load-based splitting</InternalLink>, this will be greater than the value configured by the `kv.range_split.load_qps_threshold` <InternalLink path="cluster-settings">cluster setting</InternalLink> (`2500` by default).

## See also

* <InternalLink path="understand-hotspots">Understand Hotspots</InternalLink>
* <InternalLink path="hash-sharded-indexes">Hash-sharded Indexes</InternalLink>
* <InternalLink path="architecture/overview">Architecture Overview</InternalLink>
