Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC-10466 Docs for o11y/console: Improve performance of the Databases Page for large clusters #19026

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions src/current/_includes/v24.3/ui/database-details-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Database Details Page

To view this page, click on a database name on the [Databases List Page](#databases-list-page) page. The Database Details Page has two tabs: [**Tables**](#tables-list-tab) and [**Grants**](#database-grants-tab).

You can also [refresh data](#refresh-data) that is displayed on this page and the [Databases List Page](#databases-list-page).

### Tables List Tab

Click on the **Tables** tab of the [Database Details Page](#database-details-page) to view a list of the tables in the selected database.

The following information is displayed for each table:

Column | Description
-------------------------------|-------------
Name | The name of the table. Click a table name to view the [Table Details Page](#table-details-page) page for the selected table.
Replication Size | The approximate compressed total disk size across all replicas of the table.
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/Nodes | Regions/Nodes on which the table's data is stored.{% if page.cloud == true %}<br><br>NOTE: Not available on Standard or Basic clusters.{% endif %}
% of Live Data | The percentage of total uncompressed logical data that has not been modified (updated or deleted).
Table auto stats enabled | Whether automatic [table statistics]({% link {{ version_prefix }}/cost-based-optimizer.md %}#table-statistics) is enabled. Automatic statistics can help improve query performance.
Stats last updated | The last time table statistics used by the SQL optimizer were updated.

#### Search and filter tables

By default, Tables List Tab shows all tables in a selected database.

To search for specific databases, use the search field above the table:

1. Enter a string in the search box.
1. Press `Enter`.

The list of tables is filtered by the string.

{% include_cached new-in.html version="v24.3" %} To filter databases based on the nodes on which the database tables are located, use the nodes multi-select dropdown above the table:

1. Click the dropdown arrow.
1. Select one or more nodes. You may need to scroll down for nodes in different regions. You may also type in the beginning of the node name to narrow the list.

The list of tables is filtered by the nodes selected.

{% if page.cloud == true -%}
NOTE: Nodes multi-select dropdown is not available on Standard or Basic clusters.
{% endif %}

### Database Grants Tab

{% include_cached new-in.html version="v24.3" %} Click on the **Grants** tab [Database Details Page](#database-details-page) to show the [privileges]({% link {{ version_prefix }}/security-reference/authorization.md %}#managing-privileges) granted to users and roles on the database.

The following information is displayed for each grantee:

Column | Description
-----------|-------------
Grantee | The role or user.
Privileges | The list of privileges for the role or user on the database.

For more details about grants and privileges, refer to [`GRANT`]({% link {{ version_prefix }}/grant.md %}).
43 changes: 43 additions & 0 deletions src/current/_includes/v24.3/ui/databases-list-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Databases List Page

To view this page, click **Databases** in the left side navigation menu.

The Databases List Page shows:

- Whether [automatic statistics collection]({% link {{ version_prefix }}/cost-based-optimizer.md %}#table-statistics) is enabled for the cluster. The **Auto stats collection** indicator is on the top right.
- A list of the databases on the cluster.

The following information is displayed for each database:

Column | Description
--------------|-------------
Name | The name of the database. Click a database name to view the [Database Details Page](#database-details-page) page for the selected database.
Size | The approximate total disk size across all table replicas in the database.
Tables | The total number of tables in the database.
Regions/Nodes | Regions/Nodes on which the database tables are located. Hover on a region for a list of nodes in that region.{% if page.cloud == true %}<br><br>NOTE: Not available on Standard or Basic clusters.{% endif %}

### Search and filter databases

By default, the Databases List Page shows all databases on the cluster.

To search for specific databases, use the search field above the table:

1. Enter a string in the search box.
1. Press `Enter`.

The list of databases is filtered by the string.

{% include_cached new-in.html version="v24.3" %} To filter databases based on the nodes on which the database tables are located, use the nodes multi-select dropdown above the table:

1. Click the dropdown arrow.
1. Select one or more nodes. You may need to scroll down for nodes in different regions. You may also type in the beginning of the node name to narrow the list.

The list of databases is filtered by the nodes selected.

{% if page.cloud == true -%}
NOTE: Nodes multi-select dropdown is not available on Standard or Basic clusters.
{% endif %}

### Refresh data

{% include_cached new-in.html version="v24.3" %} TODO
100 changes: 100 additions & 0 deletions src/current/_includes/v24.3/ui/databases-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
## Databases

The **Databases** page shows:

- Whether [automatic statistics collection]({{ link_prefix }}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. |
{% if page.cloud != true -%}
| Size | Approximate disk size across all table replicas in the database. |
{% endif -%}
| Tables | The number of tables in the database. |
{% if page.cloud != true -%}
| 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. |
{%- else -%}
| Regions | The regions where the tables in the database are located. |
{% endif -%}

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.
1. 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.
1. Click **Apply**.

## 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. |
{% if page.cloud != true -%}
| Replication Size | The approximate disk size of all replicas of this table on the cluster. |
| Ranges | The number of ranges in the table. |
{%- endif -%}
| Columns | The number of columns in the table. |
| Indexes | The number of indexes in the table. |
{% if page.cloud != true -%}
| Regions | The regions and nodes on which the table data is stored. This is not displayed on a single-node cluster. |
{% else -%}
| Regions | The regions where the table data is stored.
{% endif -%}
| % 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 [grants]({{ link_prefix }}grant.html) associated with the table.

#### Overview tab

The **Overview** tab displays the SQL statements used to [create the table]({{ link_prefix }}create-table.html), table details, and index statistics.

The table details include:

{% if page.cloud != true %}
- **Size**: The approximate disk size of all replicas of this table on the cluster.
- **Replicas**: The number of [replicas]({{ link_prefix }}architecture/replication-layer.html) of this table on the cluster.
- **Ranges**: The number of [ranges]({{ link_prefix }}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.
{% endif %}
- **Auto Stats Collection**: Whether [automatic statistics collection]({{ link_prefix }}cost-based-optimizer.html#table-statistics) is enabled.
{% if page.cloud != true %}
- **Regions/Nodes**: The regions and nodes on which the table data is stored. This is not displayed on a single-node cluster.
{% else %}
- **Regions**: The regions where the table data is stored.
{% endif %}
- **Database**: The database in which the table is found.
- **Indexes**: The names of the indexes defined on the table.
17 changes: 17 additions & 0 deletions src/current/_includes/v24.3/ui/index-details-page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Index Details Page

To view this page, click on a index name on the [Indexes List Tab](#indexes-list-tab) of the [Table Details Page](#table-details-page).

The **Index** page displays the SQL statement used to [create the index]({% link {{ version_prefix }}/create-index.md %}) and an index’s details. The page also allows [admin users]({% link {{ version_prefix }}/security-reference/authorization.md %}#admin-role) to [**Reset all index stats**](#reset-all-index-statistics).

The following information is displayed for the index:

Detail | Description
----------------------|-------------
Total Reads | The number of times the index was read since index statistics were reset.
Last Read | The time the index was created, last read, or index statistics were reset.
Index Recommendations | A [recommendation](#index-recommendations) to drop the index if it is unused.

### Index Usage

The **Index Usage** table displays a list of the most executed statement fingerprints using this index. This table is only visible to [Admin users]({% link {{ version_prefix }}/security-reference/authorization.md %}#admin-role). The information displayed for each statement fingerprint is similar to the table on the [**Statements**]({% link {{ version_prefix }}/ui-statements-page.md %}#statements-table) page.
45 changes: 45 additions & 0 deletions src/current/_includes/v24.3/ui/index-details-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#### 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]({{ link_prefix }}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]({{ link_prefix }}security-reference/authorization.html#admin-role) can click this to drop an unused index. |

{% if page.cloud != true %}
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. [Admin users]({% link {{ page.version.version }}/security-reference/authorization.md %}#admin-role) also see a list of executed statement fingerprints using the index.
{% endif %}

## Grants view

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

The following information is displayed for each table:

| Column | Description |
|------------|-----------------------------------|
{% if page.cloud != true -%}
| Tables | The name of the table. |
{% endif -%}
| Users | The number of users of the table. |
{% if page.cloud != true -%}
| Roles | The list of roles on the table. |
{% endif -%}
| Grants | The list of grants of the table. |

For more details about grants and privileges, see [`GRANT`]({{ link_prefix }}grant.html).

## See also

- [Statements page]({{ link_prefix }}ui-statements-page.html)
- [Assign privileges]({{ link_prefix }}security-reference/authorization.html#managing-privileges)
- [`GRANT`]({{ link_prefix }}grant.html)
- [Raw status endpoints]({{ link_prefix }}monitoring-and-alerting.html#raw-status-endpoints)
6 changes: 4 additions & 2 deletions src/current/_includes/v24.3/ui/index-recommendations.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 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.
The [Indexes List Tab](#indexes-list-tab) of the [Table Details Page](#table-details-page) shows recommendations to drop indexes based on index usage with a **Drop index** button. Admin users can click this to drop an unused index.

To configure the threshold for when CockroachDB will recommend that you drop an index due to low usage, change the [`sql.index_recommendation.drop_unused_duration` cluster setting]({{ link_prefix }}cluster-settings.html). The default value is 7 days.
The [Index Details Page](#index-details-page) also shows recommendations to drop the selected index based on index usage.

To configure the threshold for when CockroachDB will recommend that you drop an index due to low usage, change the [`sql.index_recommendation.drop_unused_duration` cluster setting]({% link {{ version_prefix }}/cluster-settings.md %}). The default value is 7 days.
2 changes: 1 addition & 1 deletion src/current/_includes/v24.3/ui/statement-details.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The plan table shows the following details:
Column | Description
-----|----
Plan Gist | A sequence of bytes representing the flattened tree of operators and operator-specific metadata of the statement plan.
Used Indexes | The table [indexes]({{ link_prefix }}indexes.html) used by the plan. To see [table details]({{ link_prefix }}ui-databases-page.html#table-details), click on the table name. To see [index details]({{ link_prefix }}ui-databases-page.html#index-details), click on the index name.
Used Indexes | The table [indexes]({{ link_prefix }}indexes.html) used by the plan. To see [table details]({{ link_prefix }}ui-databases-page.html#table-details-page), click on the table name. To see [index details]({{ link_prefix }}ui-databases-page.html#index-details-page), click on the index name.
Insights | The number of [insights](#insights) for the plan. To configure when to trigger insights, see [Schema insights settings]({{ link_prefix }}ui-insights-page.html#schema-insights-settings).
Last Execution Time | The timestamp when the statement was last executed.
Average Execution Time | The average execution time for all the executions of the plan.
Expand Down
Loading
Loading