The Transactions page helps you:
- Identify frequently retried transactions.
- Troubleshoot high latency transactions or execution failures.
- View transaction details.
To view this page, select a cluster from the Clusters page, and click SQL Activity in the Monitoring section of the left side navigation. Select the Transactions tab.
Transaction Fingerprints results
The transaction fingerprints returned are determined by the selected Search Criteria:
By default, the Top
100 transaction fingerprints By
Transaction Time for the
Past Hour are returned.
- To change the number of results returned, select
500from the Top dropdown. To return a larger number, select
Moreand choose an option:
- To change the sort column, from the By dropdown, select a commonly sorted column:
Execution Count, or
Transaction Time. To sort by other columns, select
Morefrom the dropdown and choose an option:
Moreoptions may increase the page loading time and are not generally recommended.
- Select the Time Range.
The list of transactions that satisfy the search criteria is displayed. The results can be further searched and filtered.
Results are not automatically refreshed.
The actual time range of the statistics is displayed at the top right of the results, for example,
Showing aggregated stats from 20:00 to 21:59 (UTC). If you select a preset time interval, such as
Past Hour, be aware that since the statistics displayed are not automatically refreshed, they may become stale. To see the latest statistics, update the Search Criteria and apply.
However, it may take up to 10 minutes for the most recent statistics to be included in the aggregated statistics. 10 minutes is the default for the
sql.stats.flush.interval cluster setting. For in-memory statistics, directly query the following in-memory table:
To view transaction fingerprints within a specific time interval, select a time interval from the selector at the top of the tab. The time interval field supports preset time intervals (1 Hour, 6 Hours, 1 Day, etc.) and custom time intervals. To select a custom time interval, click the time interval field and select Custom time interval. In the Start (UTC) and End (UTC) fields select or type a date and time.
Use the arrow buttons to cycle through previous and next time intervals. To select the most recent interval, click Now. When you select a time interval, the same interval is selected in the Metrics page.
CockroachDB persists transaction statistics up to 1 million rows before the oldest row is deleted. The retention period of statistics is reduced the more active a workload is and the more distinct statement fingerprints there are.
It's possible to select an interval for which no transaction statistics exist.
Search and filter
By default, the Transactions page shows transactions from all applications and databases running on the cluster.
For the Transaction Fingerprints view, the search and filter are applied after results are returned based on the Search Criteria.
To search using the search field:
- 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.
The list of transactions is filtered by the string.
To filter the transactions:
Click the Filters field.
To filter by application, select App and select one or more applications.
- Queries from the SQL shell are displayed under the
- If you haven't set
application_namein a client connection string, it appears as
- Queries from the SQL shell are displayed under the
To filter by the nodes on which the transaction ran, click the Node field and select one or more checkboxes.
To display only statement fingerprints that take longer than a specified time to run, specify the time and units.
The following screenshot shows the transactions that contain the string
rides for the
movr application filtered by
Runs Longer Than: 300 milliseconds:
Statistics aggregation is controlled by the
sql.stats.aggregation.interval cluster setting, set to 1 hour by default.
Aggregated statistics are flushed from memory to statistics tables in the
crdb_internal system catalog every 10 minutes. The flushing interval is controlled by the
sql.stats.flush.interval cluster setting.
The default retention period of the statistics tables is based on the number of rows up to 1 million records. When this threshold is reached, the oldest records are deleted. The
diagnostics.forced_sql_stat_reset.interval cluster setting controls when persisted statistics are deleted only if the internal cleanup service experiences a failure.
If desired, admin users may reset SQL statistics in the DB Console UI and
crdb_internal system catalog by clicking reset SQL stats. This link does not appear for non-admin users.
For an example of querying the statistics table, see Example.
If you haven't yet executed any transactions in the cluster as a user, this page will be blank.
Click Columns to select the columns to display in the table.
The Transactions table gives details for each transaction fingerprint in the transaction:
|Transactions||The SQL statement fingerprints that make up the transaction. To view the transaction fingerprint and details, click to open the Transaction Details page.|
|Execution Count||Cumulative number of executions of this transaction within the time interval.
The bar indicates the ratio of runtime success (gray) to retries (red) for the transaction.
|Application Name||The name specified by the
|Rows Processed||Average number of rows read and written while executing statements with this fingerprint within the time interval.|
|Bytes Read||Aggregation of all bytes read from disk across all operators for this transaction within the time interval.
The gray bar indicates the mean number of bytes read from disk. The blue bar indicates one standard deviation from the mean.
|Transaction Time||Average planning and execution time of this transaction within the time interval.
The gray bar indicates the mean latency. The blue bar indicates one standard deviation from the mean.
|Contention Time||Average time this transaction was in contention with other transactions within the time interval.
The gray bar indicates mean contention time. The blue bar indicates one standard deviation from the mean. Hover over the bar to display exact values.
|CPU Time||Average CPU time spent executing within the specified time interval.
The gray bar indicates mean CPU time. The blue bar indicates one standard deviation from the mean.
The CPU time includes time spent in the SQL layer. It does not include time spent in the storage layer.
|Max Memory||Maximum memory used by this transaction at any time during its execution within the time interval.
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 for this transaction within the time interval.
If this value is 0, the transaction was executed on a single node.
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 of this transaction within the time interval.|
|Regions/Nodes||The region and nodes in which the transaction was executed.
Nodes are not visible for CockroachDB Serverless clusters.
|Statements||Number of SQL statements in the transaction.|
|Transaction Fingerprint ID||The ID of the transaction fingerprint.|
Significant transactions on your database are likely to have a high execution count or number of rows read.
To view details of a transaction, click a transaction fingerprint in the Transactions column to open the Transaction Details page.
Transaction Details page
The details displayed on the Transaction Details page reflect the time interval selected on the Transactions page.
- The transaction fingerprint is displayed as a list of the individual SQL statement fingerprints in the transaction.
- The Mean transaction time: The mean average time it took to execute the transaction within the aggregation interval.
- The Application name: The name specified by the
- Transaction resource usage shows overall statistics about the transaction.
- Mean rows/bytes read: The mean average number of rows and bytes read from the storage layer during the execution of the transaction within the specified aggregation interval.
- Bytes read over network: The amount of data transferred over the network for this transaction within the aggregation interval.
If this value is 0, the statement was executed on a single node.
- Mean rows written: The mean number of rows written by this transaction.
- Max memory usage: The maximum memory used by this transaction at any time during its execution within the aggregation interval.
- Max scratch disk usage: The maximum amount of data spilled to temporary storage on disk while executing this transaction within the aggregation interval.
The Insights table is displayed when CockroachDB has detected a problem with the transaction fingerprint.
- Insights: Provides the Workload Insight type.
- Details: Provides a description and possible recommendation.
- Latest Execution ID: The ID of the latest transaction execution. To display the details of the transaction execution, click the ID.
The Statements Fingerprints table displays the statement fingerprints of all the statements in the transaction. To display the details of a statement fingerprint, click a statement fingerprint.