Postgresql 监控慢查询

select * from pg_stat_activity where state<>'idle' and now()-query_start > interval '1 s' order by query_start ;