Skip to content

Commit

Permalink
Updates to the Transactions and Statements pages for v21.2. (cockroac…
Browse files Browse the repository at this point in the history
…hdb#11618)

* Updates to the Transactions and Statements pages for v21.2.

* Fixing anchor link.
  • Loading branch information
Ian Evans authored Sep 13, 2021
1 parent c8db709 commit 9184148
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
6 changes: 4 additions & 2 deletions _includes/v21.2/ui/statement_table.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Statement | SQL statement [fingerprint](ui-statements-page.html#sql-statement-fingerprints).<br><br>To view additional details, click the SQL statement fingerprint to open its [**Statement Details** page](ui-statements-page.html#statement-details-page).
Statements | SQL statement [fingerprint](ui-statements-page.html#sql-statement-fingerprints).<br><br>To view additional details, click the SQL statement fingerprint to open its [**Statement Details** page](ui-statements-page.html#statement-details-page).
Execution Count | Cumulative number of executions of statements with this fingerprint within the last hour or specified [time interval](#time-interval). <br><br>The bar indicates the ratio of runtime success (gray) to [retries](transactions.html#transaction-retries) (red) for the SQL statement fingerprint.
Rows Read | Average number of rows [read from disk](architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) while executing statements with this fingerprint within the last hour or specified [time interval](#time-interval).<br><br>The gray bar indicates the mean number of rows returned. The blue bar indicates one standard deviation from the mean.
Bytes Read | Aggregation of all bytes [read from disk](architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) across all operators for statements with this fingerprint within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates the mean number of bytes read from disk. The blue bar indicates one standard deviation from the mean.
Statement Time | Average [planning and execution time](architecture/sql-layer.html#sql-parser-planner-executor) of statements with this fingerprint within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates the mean latency. The blue bar indicates one standard deviation from the mean.
Contention | Average time statements with this fingerprint were [in contention](performance-best-practices-overview.html#understanding-and-avoiding-transaction-contention) with other transactions within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates mean contention time. The blue bar indicates one standard deviation from the mean.
Max Memory | Maximum memory used by a statement with this fingerprint at any time during its execution within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates the average max memory usage. The blue bar indicates one standard deviation from the mean.
Network | Amount of [data transferred over the network](architecture/reads-and-writes-overview.html) (e.g., between regions and nodes) for statements with this fingerprint within the last hour or specified [time interval](#time-interval). <br><br>If this value is 0, the statement was executed on a single node. <br><br>The gray bar indicates the mean number of bytes sent over the network. The blue bar indicates one standard deviation from the mean.
Retries | Cumulative number of [retries](transactions.html#transaction-retries) of statements with this fingerprint within the last hour or specified [time interval](#time-interval).
Retries | Cumulative number of [retries](transactions.html#transaction-retries) of statements with this fingerprint within the last hour or specified [time interval](#time-interval).
% of All Runtime | This statistic represents how much time this statement fingerprint took to execute compared to all other statements that were executed within the time period. It is expressed as a percentage. The runtime is the mean execution latency multiplied by the execution count.
|
13 changes: 8 additions & 5 deletions v21.2/ui-statements-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ To filter the statements by [`application_name`](connection-parameters.html#addi

CockroachDB's internal queries are displayed under the `(internal)` app. Queries from the SQL shell are displayed under the `$ cockroach sql` app.

You can also search for statements using the search bar.
You can also search for statements using the search bar, or using the date bar. To search by date pick a date range that is within the time period since the statistics were last cleared, indicated on the upper right of the table. Click **reset time** to reset the date.

Click **Clear SQL Stats** to clear the statistics.

## Understand the Statements page

Expand Down Expand Up @@ -78,7 +80,7 @@ Click on a SQL statement fingerprint to open **Statement Details**. For each sta

- [Overview](#overview)
- [Diagnostics](#diagnostics)
- [Logical plan](#logical-plan)
- [Explain plan](#explain-plan)
- [Execution stats](#execution-stats)

### Overview
Expand All @@ -104,6 +106,7 @@ The **Overview** section displays the SQL statement fingerprint and essential st
- **Distributed execution?** indicates whether the execution was distributed.
- **Vectorized execution?** indicates whether the execution used the [vectorized execution engine](vectorized-execution.html).
- **Transaction type** displays the type of transaction (implicit or explicit).
- **Last execution time** shows when the statement was last executed.

**Execution counts** displays execution statistics for the SQL statement fingerprint.

Expand Down Expand Up @@ -138,11 +141,11 @@ The information collected in the bundle can be used to diagnose problematic SQL

Click **All statement diagnostics** to view a complete history of your collected diagnostics, each of which can be downloaded. Although fingerprints are periodically cleared from the Statements page, all diagnostics bundles are preserved. If you need to access diagnostics that were collected for a fingerprint not present in the past [interval](#time-interval), you can find the bundle here.

### Logical Plan
### Explain Plan

The **Logical Plan** section displays CockroachDB's query plan for an [explainable statement](sql-grammar.html#preparable_stmt). You can use this information to optimize the query. For more information about logical plans, see [`EXPLAIN`](explain.html).
The **Explain Plan** section displays CockroachDB's statement plan for an [explainable statement](sql-grammar.html#preparable_stmt). You can use this information to optimize the query. For more information about plans, see [`EXPLAIN`](explain.html).

By default, the logical plan for each fingerprint is sampled every 5 minutes. You can change the interval with the [`sql.metrics.statement_details.plan_collection.period`](cluster-settings.html#settings) cluster setting. For example, to change the interval to 2 minutes, run the following [`SET CLUSTER SETTING`](set-cluster-setting.html) command:
By default, the explain plan for each fingerprint is sampled every 5 minutes. You can change the interval with the [`sql.metrics.statement_details.plan_collection.period`](cluster-settings.html#settings) cluster setting. For example, to change the interval to 2 minutes, run the following [`SET CLUSTER SETTING`](set-cluster-setting.html) command:

{% include copy-clipboard.html %}
~~~ sql
Expand Down
7 changes: 5 additions & 2 deletions v21.2/ui-transactions-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ To filter the transactions by [`application_name`](connection-parameters.html#ad
- CockroachDB's internal transactions are only displayed under the `$ internal` app.
- Transactions from the SQL shell are displayed under the `$ cockroach sql` app.

You can also search for transactions using the search bar.
You can also search for transactions using the search bar, or by date using the date bar. To search by date pick a date range that is within the time period since the statistics were last cleared, indicated on the upper right of the table. Click **reset time** to reset the date.

Click **Clear SQL Stats** to clear the statistics.

## Filter by transaction latency

Expand All @@ -48,11 +50,12 @@ Transactions | The [SQL statement fingerprints](ui-statements-page.html#sql-stat
Execution Count | Cumulative number of executions of this transaction within the last hour or specified [time interval](#time-interval). <br><br>The bar indicates the ratio of runtime success (gray) to [retries](transactions.html#transaction-retries) (red) for the transaction.
Rows Read | Average number of rows [read from disk](architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) while executing this transaction within the last hour or specified [time interval](#time-interval).<br><br>The gray bar indicates the mean number of rows returned. The blue bar indicates one standard deviation from the mean.
Bytes Read | Aggregation of all bytes [read from disk](architecture/life-of-a-distributed-transaction.html#reads-from-the-storage-layer) across all operators for this transaction within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates the mean number of bytes read from disk. The blue bar indicates one standard deviation from the mean.
Statement Time | Average [planning and execution time](architecture/sql-layer.html#sql-parser-planner-executor) of this transaction within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates the mean latency. The blue bar indicates one standard deviation from the mean.
Transaction Time | Average [planning and execution time](architecture/sql-layer.html#sql-parser-planner-executor) of this transaction within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates the mean latency. The blue bar indicates one standard deviation from the mean.
Contention | Average time this transaction was [in contention](performance-best-practices-overview.html#understanding-and-avoiding-transaction-contention) with other transactions within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates mean contention time. The blue bar indicates one standard deviation from the mean.
Max Memory | Maximum memory used by this transaction at any time during its execution within the last hour or specified [time interval](#time-interval). <br><br>The gray bar indicates the average max memory usage. The blue bar indicates one standard deviation from the mean.
Network | Amount of [data transferred over the network](architecture/reads-and-writes-overview.html) (e.g., between regions and nodes) for this transaction within the last hour or specified [time interval](#time-interval). <br><br>If this value is 0, the transaction was executed on a single node. <br><br>The gray bar indicates the mean number of bytes sent over the network. The blue bar indicates one standard deviation from the mean.
Retries | Cumulative number of [retries](transactions.html#transaction-retries) of this transaction within the last hour or specified [time interval](#time-interval).
Regions/Nodes | The region and nodes in which the transaction was executed.
Statements | Number of SQL statements in the transaction.

{{site.data.alerts.callout_info}}
Expand Down

0 comments on commit 9184148

Please sign in to comment.