diff --git a/PostgreSQL/long_running.sql b/PostgreSQL/long_running.sql new file mode 100644 index 0000000..2ed7afb --- /dev/null +++ b/PostgreSQL/long_running.sql @@ -0,0 +1,7 @@ +SELECT + pid, + now() - pg_stat_activity.query_start AS duration, + query, + state +FROM pg_stat_activity +WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes'; \ No newline at end of file