PostgreSQL Show/Stop Long Running Queries
Sometimes when playing around with large PostgreSQL datasets in an SQL GUI, Grafana dashboards, or from any other tool, you might make a query mistake which makes the query run forever. This could eat up your database CPU or your max IOPs (in case of cloud services). You can find long running queries by executing the next command in an SQL GUI: To nicely ask all long running queries to be stopped, execute this: And if you want a forced…