pgtoolkit/pgstats.py
changeset 39 0cef3540b69f
parent 9 2fcc8ef0b97d
child 44 4fe39c59c515
--- a/pgtoolkit/pgstats.py	Thu May 31 11:28:41 2012 +0200
+++ b/pgtoolkit/pgstats.py	Mon Jul 09 10:29:47 2012 +0200
@@ -44,6 +44,7 @@
         return self._query('''SELECT datname, procpid, usename, current_query AS query,
             waiting, xact_start, query_start, backend_start
             FROM pg_stat_activity
-            WHERE current_query <> '<IDLE>' AND query_start < now() - interval %s;''',
+            WHERE current_query <> '<IDLE>' AND query_start < now() - interval %s
+            ORDER BY query_start;''',
             longer_than)