Hardik Gondaliya
Hardik Gondaliya

Reputation: 326

postgresql 9.3 log slow queries

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.

Upvotes: 4

Views: 5444

Answers (1)

radoslaw.jarzynka
radoslaw.jarzynka

Reputation: 241

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

Upvotes: 10

Related Questions