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