Having something like [PostgreSQL's log_min_duration_statement](http://www.postgresql.org/docs/current/static/runtime-config-logging.html) would be useful to debug performance problems.