Analysing/Profiling queries on PostgreSQL

后端 未结 2 1807
有刺的猬
有刺的猬 2020-12-31 12:34

I\'ve just inherited an old PostgreSQL installation and need to do some diagnostics to find out why this database is running slow. On MS SQL you would use a tool such as Pro

2条回答
  •  清歌不尽
    2020-12-31 12:59

    Use pg_stat_statements extension to get long running queries. then use select* from pg_stat_statements order by total_time/calls desc limit 10 to get ten longest. then use explain to see the plan...

提交回复
热议问题