Show slow queries on postgresql

In postgresql it’s pretty easy to show which queries can be optimized on
your application. Or, at least, which queries are more time consuming.

Just execute the following statement on your database

1
ALTER DATABASE myDatabase SET log_min_duration_statement = 5000;

to show which queres takes more than 5 seconds.

Output will go to your postgresql system log.

More information about Postgresql performance