> ## 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.

# Databases 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 <InternalLink path="secure-a-cluster">secure cluster</InternalLink>, you must be an `admin` user to access this area of the DB Console. Refer to <InternalLink path="ui-overview#db-console-access">DB Console security</InternalLink>.
</Note>

The **Databases** page of the DB Console provides details of the following:

* The databases configured.
* The tables in each database and the indexes on each table.
* The grants assigned to each role and user.
* [Index recommendations](#index-recommendations).

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

## Index recommendations

The [**Databases**](#databases), [table details](#table-details), and [index details](#index-details) pages show recommendations to drop indexes based on index usage. You can traverse the **Databases** page and **Tables** view to determine which indexes have recommendations.

To configure the threshold for when CockroachDB will recommend that you drop an index due to low usage, change the <InternalLink path="cluster-settings">`sql.index_recommendation.drop_unused_duration` cluster setting</InternalLink>. The default value is 7 days.

## Databases

The **Databases** page shows:

* Whether [automatic statistics collection](cost-based-optimizer.html#table-statistics) is enabled for the cluster.
* A list of the databases on the cluster.

The following information is displayed for each database:

| Column                                                 | Description                                                                                                            |
| ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| Databases                                              | The name of the database.                                                                                              |
| Size                                                   | Approximate disk size across all table replicas in the database.                                                       |
| Tables                                                 | The number of tables in the database.                                                                                  |
| Range Count                                            | The number of ranges across all tables in the  database.                                                               |
| Regions/Nodes                                          | The regions and nodes on which the tables in the database are located. This is not displayed on a single-node cluster. |
| Index Recommendations                                  | The number of index recommendations for the database.                                                                  |
| Click a **database name** to open the **Tables** page. |                                                                                                                        |

* Select **View: Tables** in the pulldown menu to display the [Tables view](#tables-view).
* Select **View: Grants** in the pulldown menu to display the [Grants view](#grants-view).

## Search and filter

By default, the Databases page shows all databases running on the cluster. By default, the [**Tables** view](#tables-view) and the [**Grants** view](#grants-view) show all tables in a selected database.

### Search databases or tables

To search using the search field:

1. Enter a string in the search box at the top of the tab. To search for exact terms in order, wrap the search string in quotes.
2. Press `Enter`.

   The list of databases or tables is filtered by the string.

### Filter

To filter the databases on the **Databases** page or tables on the [**Tables** view](#tables-view) or the [**Grants** view](#grants-view):

1. Click the **Filters** field.
   * To filter by one or more nodes on which the data reside for the database or table, select **Node** and select one or more nodes.
2. Click **Apply**.

<a id="data-exposed-by-crdb_internal" />

## Tables view

The **Tables** view shows the tables in your database.

The following information is displayed for each table:

| Column                         | Description                                                                                              |
| ------------------------------ | -------------------------------------------------------------------------------------------------------- |
| Tables                         | The name of the table.                                                                                   |
| Replication Size               | The approximate disk size of all replicas of this table on the cluster.                                  |
| Ranges                         | The number of ranges in the table.                                                                       |
| Columns                        | The number of columns in the table.                                                                      |
| Indexes                        | The number of indexes in the table.                                                                      |
| Regions                        | The regions and nodes on which the table data is stored. This is not displayed on a single-node cluster. |
| % of Live Data                 | Percent of total uncompressed logical data that has not been modified (updated or deleted).              |
| Table Stats Last Updated (UTC) | The last time table statistics were created or updated.                                                  |

Click a **table name** to view table details.

### Table details

The table details page contains details of a table. It contains an **Overview** tab and a **Grants** tab displays the users and <InternalLink path="grant">grants</InternalLink> associated with the table.

#### Overview tab

The **Overview** tab displays the SQL statements used to <InternalLink path="create-table">create the table</InternalLink>, table details, and index statistics.

The table details include:

* **Size**: The approximate disk size of all replicas of this table on the cluster.

* **Replicas**: The number of <InternalLink path="architecture/replication-layer">replicas</InternalLink> of this table on the cluster.

* **Ranges**: The number of [ranges](architecture/glossary.html#architecture-range) in this table.

* **% of Live Data**: Percentage of total uncompressed logical data that has not been modified (updated or deleted).

* **Table Stats Last Updated**: The last time table statistics were created or updated.

* **Auto Stats Collection**: Whether [automatic statistics collection](cost-based-optimizer.html#table-statistics) is enabled.

* **Regions/Nodes**: The regions and nodes on which the table data is stored. This is not displayed on a single-node cluster.

* **Database**: The database in which the table is found.

* **Indexes**: The names of the indexes defined on the table.

#### Index details

The **Index Stats** table displays index statistics for a table.

Index statistics accumulate from the time an index was created or when statistics were reset. If desired, [admin users](security-reference/authorization.html#admin-role) may reset index statistics for the cluster by clicking **Reset all index stats**. This link does not appear for non-admin users.

The following information is displayed for each index:

| Column                | Description                                                                                             |
| --------------------- | ------------------------------------------------------------------------------------------------------- |
| Indexes               | The name of the index.                                                                                  |
| Total Reads           | The number of times the index was read since index statistics were reset.                               |
| Last Used (UTC)       | The time the index was created, last read, or index statistics were reset.                              |
| Index Recommendations | A recommendation to drop the index if it is unused.                                                     |
| **Drop index** button | [Admin users](security-reference/authorization.html#admin-role) can click this to drop an unused index. |

Click an **index name** to view index details. The index details page displays the query used to create the index, the number of times the index was read since index statistics were reset, the time the index was last read, and the reason for the index recommendation. <InternalLink path="security-reference/authorization#admin-role">Admin users</InternalLink> also see a list of executed statement fingerprints using the index.

## Grants view

The **Grants** view shows the [privileges](security-reference/authorization.html#managing-privileges) granted to users and roles for each database.

The following information is displayed for each table:

| Column | Description                       |
| ------ | --------------------------------- |
| Tables | The name of the table.            |
| Users  | The number of users of the table. |
| Roles  | The list of roles on the table.   |
| Grants | The list of grants of the table.  |

For more details about grants and privileges, see <InternalLink path="grant">`GRANT`</InternalLink>.

## See also

* <InternalLink path="ui-statements-page">Statements page</InternalLink>
* [Assign privileges](security-reference/authorization.html#managing-privileges)
* <InternalLink path="grant">`GRANT`</InternalLink>
* [Raw status endpoints](monitoring-and-alerting.html#raw-status-endpoints)
