Skip to content

Instantly share code, notes, and snippets.

@nplusp
Created August 9, 2017 13:59
Show Gist options
  • Save nplusp/b6ebd6998e03d9cee83e46f174faab31 to your computer and use it in GitHub Desktop.
Save nplusp/b6ebd6998e03d9cee83e46f174faab31 to your computer and use it in GitHub Desktop.
Catch slow queries in Postgres
cat /etc/postgresql/9.6/main/postgresql.conf | grep log_min_duration_statement
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
log_min_duration_statement = 100
sudo tail -f /var/log/postgresql/postgresql-9.6-main.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment