Database Connections
See your running queries and stop the one blocking your app.
Stage:
General Availability
Available on self-hosted:
Yes
When your app slows down or hangs, Database Connections shows which queries are slow or stuck and which one holds up the most others. You can cancel a query or end a session without writing SQL.
Key benefits
- Start with the top blocker: Top blocker names the query that blocks the most others, so you know where to look first.
- Find the root blocker: The Root blockers filter lists sessions that block others but aren't blocked themselves, the ones to stop first.
- Slow and stuck sessions stand out: Run time turns amber at 30 seconds for an active query and red at 10 seconds for a transaction left open with nothing running.
- Read each session's details: Every row shows the query text, state, process ID (PID), and run time, so you can tell what each session is doing.
- Connections by service: Filter by application name to see which service holds the connections.
- Stop a session from the same page: Open the row's menu and choose Cancel query or Terminate session to clear the block.
- Get a summary: Click Summarize activity and the AI Assistant lists blocked, stuck, and slow sessions by PID.
When to use Database Connections
- One query holds a lock and the rest of your app waits (Top blocker)
- A migration hangs because an open transaction holds a lock (the Idle in transaction count and Terminate session)
- Your app's connections keep climbing and you can't tell which service opened them (the application name filter)
How it works
If a query waits on more than one session, the Blocked by column lists them all, but the chain shows only the first. Cancel query works only on active queries. Neither action works on a session owned by a superuser role.
Get started
- In the dashboard, open Observability, then Database Connections. It's on by default for every project, including self-hosted.
- Read Diagnosing stuck and blocked queries.