postgresql 9.3 log slow queries

断了今生、忘了曾经 提交于 2020-01-02 05:29:12

问题


I am using Rails application with Postgres 9.3 database and doing some performance fixes. I would like to know how to find out slowest queries in log files. let say queries taking more then 30ms.


回答1:


In postgresql.conf you should uncomment line

#log_min_duration_statement = -1

and change its value to 30. This way queries longer than 30ms will be logged



来源:https://stackoverflow.com/questions/41746897/postgresql-9-3-log-slow-queries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!