show longest queries in postgres log


/ Published in: Bash
Save to your folder(s)

maybe you must replace "Dauer" with the correct spelling in your logging language (i´ve done this on a german system).
also make sure, that the duration (the value in ms) column is the 5th one in your log file.


Copy this code and paste it in your HTML
  1. grep "Dauer:" /path/to/postgres.log | sort -nr -k 5 | head -100 | less

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.