SHOW RANGE ... FOR ROW shows information about a for a single row in a table or index. This information is useful for verifying how SQL data maps to underlying ranges, and where the replicas for a range are located.
This feature is in and subject to change. To share feedback and/or issues, contact Support.
To show information about the ranges for all data in a table, index, or database, use the statement.
Syntax
Required privileges
The user must have theSELECT on the target table.
Parameters
| Parameter | Description |
|---|---|
tablename | The name of the table that contains the row that you want range information about. |
indexname | The name of the index that contains the row that you want range information about. |
(value1, value2, ...) | The values of the indexed columns of the row that you want range information about, as a tuple. In previous releases, this statement required the values of all columns of a row. |
Response
The following fields are returned:| Field | Description |
|---|---|
start_key | The start key for the range. |
end_key | The end key for the range. |
range_id | The range ID. |
lease_holder | The node that contains the range’s . |
lease_holder_locality | The of the leaseholder. |
replicas | The nodes that contain the range . |
replica_localities | The of the range. |
Examples
Setup
The following examples use MovR, a fictional vehicle-sharing application, to demonstrate CockroachDB SQL statements. For more information about the MovR example application and dataset, see . To follow along, run to start a temporary, in-memory cluster with themovr dataset preloaded:

