Sha256: 9f17b33b48979f8371218a2ce5fdb6d5fd9162a0c036b3cea3be3cf76b0b4a65

Contents?: true

Size: 359 Bytes

Versions: 17

Compression:

Stored size: 359 Bytes

Contents

/* All queries longer than five minutes by descending duration */

SELECT
  pid,
  now() - pg_stat_activity.query_start AS duration,
  query AS query
FROM
  pg_stat_activity
WHERE
  pg_stat_activity.query <> ''::text
  AND state <> 'idle'
  AND now() - pg_stat_activity.query_start > interval '5 minutes'
ORDER BY
  now() - pg_stat_activity.query_start DESC;

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
ruby-pg-extras-1.2.4 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-1.2.3 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-1.2.2 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-1.2.1 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-1.2.0 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-1.1.0 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-1.0.0 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-0.7.0 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-0.6.2 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-0.6.1 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-0.6.0 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-0.0.3 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-0.0.2 lib/ruby-pg-extras/queries/long_running_queries.sql
ruby-pg-extras-0.0.1 lib/ruby-pg-extras/queries/long_running_queries.sql
rails-pg-extras-0.5.2 lib/rails-pg-extras/queries/long_running_queries.sql
rails-pg-extras-0.5.1 lib/rails-pg-extras/queries/long_running_queries.sql
rails-pg-extras-0.5.0 lib/rails-pg-extras/queries/long_running_queries.rb