Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit cc328a8

Browse files
committed
Filter slow queries per database
1 parent 0498165 commit cc328a8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gauges/slow_queries.go

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
const slowQueriesQuery = `
1212
SELECT total_time, query
1313
FROM pg_stat_statements
14+
WHERE dbid = (SELECT datid FROM pg_stat_database WHERE datname = current_database())
1415
ORDER BY total_time desc limit 10
1516
`
1617

0 commit comments

Comments
 (0)