Dives: Composable visualizations built by your favorite agentsJoin the livestream

Skip to main content
info

This is a preview feature. Preview features may be operationally incomplete and may offer limited backward compatibility.

Monitoring active server connections

tip

You can also monitor running queries in the MotherDuck UI under SettingsRunning Queries. See Running Queries for details.

For an org-wide view of running and recently completed queries, see the RECENT_QUERIES view (for admins on the Business plan).

The md_active_server_connections table function can be used to list all server-side connections that have active transactions.

Syntax

FROM md_active_server_connections();

This returns a list of active server connections, with the following information:

column_namecolumn_typedescription
client_duckdb_idUUIDUnique identifier for the client DuckDB instance that initiated the connection
client_user_agentVARCHARUser agent for the client
client_duckdb_versionUSMALLINT[3]DuckDB version from the client
client_connection_idUUIDUnique identifier for the client DuckDB connection that initiated the connection
client_transaction_idUBIGINTIdentifier for the transaction within the current connection
server_transaction_stageVARCHARStage the server-side transaction is in
server_transaction_elapsed_timeINTERVALHow long the server-side transaction has been in the current stage
client_query_idUBIGINTIdentifier for the query within the current transaction
client_queryVARCHARQuery string (possibly truncated)
server_query_elapsed_timeINTERVALHow long the query has been running on the server-side
server_query_execution_elapsed_timeINTERVALHow long the connection has been interrupted
server_query_progressDOUBLEProgress information (value between 0.0 and 1.0)
server_interrupt_elapsed_timeINTERVALHow long the connection has been interrupted
server_interrupt_reasonVARCHARWhy the connection was interrupted
query_total_upload_sizeUBIGINTData uploaded in Bytes
query_total_download_sizeUBIGINTData downloaded in Bytes