JAEN

SQL

Show running queries

SafeShow running queries

SHOW PROCESSLIST;

See running queries and locks to find what is slow or stuck.

Examples

  • SELECT * FROM pg_stat_activity WHERE state='active';Active queries in PostgreSQL

Syntax

SHOW FULL PROCESSLIST; (PG) SELECT * FROM pg_stat_activity;

Before you run it

Read-only.

Used when you see

Slow database queries
1
See what's running and for how long
See the whole flow →
Can't connect to the database
4
Identify connection hogs
See the whole flow →
Replication lagging or stopped
2
Check load and long queries on the source
See the whole flow →
Deadlocks and lock waits
1
Identify sessions stuck waiting
See the whole flow →

Related commands

The same reference, with no signal at all

Every command and flow from this site, held on your device and searchable with no connection. Free to install, no ads.

Get it free on the App Store