АРХИВ ПО ТЭГУ "POSTGRESQL"
МАЙ 7, 2015

Queries which are running for more than 10 seconds so far:

  1. SELECT datname,waiting,now()-query_start,current_query
  2. FROM pg_stat_activity
  3. WHERE now()-query_start > interval '00:00:10'
  4. ORDER BY query_start ASC;
АПРЕЛЬ 17, 2015

Just a note on how to get running time for a query defined by regex:

  1. SELECT datname,waiting,now()-query_start,current_query
  2. FROM pg_stat_activity
  3. WHERE current_query ilike '%YOUR QUERY REGEX GOES HERE%'
  4. ORDER BY procpid;