Skip to main content
The SHOW TRANSACTIONS lists details about currently active transactions, including:
  • The node running the transaction
  • The application that initiated the transaction
  • The number of statements that have been executed on the transaction
  • The number of times the transaction was retried (both manually and by the SQL executor)
These details let you monitor the overall state of transactions and identify those that may need further investigation or adjustment.

Required privileges

No are required to execute this statement. However, note that non-admin users see only their own currently active transactions, whereas the admin users see all users’ currently active transactions.

Syntax

  • To list the active transactions across all nodes of the cluster, use SHOW TRANSACTIONS or SHOW CLUSTER TRANSACTIONS.
  • To list the active transactions just on the gateway node, use SHOW LOCAL TRANSACTIONS.
  • To list internal transactions (that are issued by the database itself), use SHOW ALL.. TRANSACTIONS.

Response

The following fields are returned for each transaction:

Examples

List active transactions across the cluster

Alternatively, you can use SHOW TRANSACTIONS to receive the same response.

List active transactions on the gateway node

Filter for specific transactions

You can use a statement to filter the list of currently active transactions by one or more of the response fields.

Show transactions associated with a specific application

Exclude transactions from the built-in SQL client

To exclude transactions from the , filter for transactions that do not show $ cockroach sql as the application_name:

See also