12 lines
1.0 KiB
Markdown
12 lines
1.0 KiB
Markdown
# db-long-running-queries
|
|
|
|
This command displays currently running queries, that have been running for longer than 5 minutes, descending by duration. Very long running queries can be a source of multiple issues, such as preventing DDL statements completing or vacuum being unable to update `relfrozenxid`.
|
|
|
|
```
|
|
PID │ DURATION │ QUERY
|
|
───────┼─────────────────┼───────────────────────────────────────────────────────────────────────────────────────
|
|
19578 | 02:29:11.200129 | EXPLAIN SELECT "students".* FROM "students" WHERE "students"."id" = 1450645 LIMIT 1
|
|
19465 | 02:26:05.542653 | EXPLAIN SELECT "students".* FROM "students" WHERE "students"."id" = 1889881 LIMIT 1
|
|
19632 | 02:24:46.962818 | EXPLAIN SELECT "students".* FROM "students" WHERE "students"."id" = 1581884 LIMIT 1
|
|
```
|