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

Commit 91cb00c

Browse files
committed
Fix database (dead|live) tuples queries
1 parent 3c72755 commit 91cb00c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gauges/table_rows.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (g *Gauges) DatabaseDeadRows() prometheus.Gauge {
5050
Help: "Estimated number of dead rows in a database",
5151
ConstLabels: g.labels,
5252
},
53-
"SELECT sum(coalesce(n_dead_tup, 0)) as n_dead_tup FROM pg_stat_user_tables",
53+
"SELECT coalesce(sum(n_dead_tup), 0) as n_dead_tup FROM pg_stat_user_tables",
5454
)
5555
}
5656

@@ -98,6 +98,6 @@ func (g *Gauges) DatabaseLiveRows() prometheus.Gauge {
9898
Help: "Estimated number of live rows in a database",
9999
ConstLabels: g.labels,
100100
},
101-
"SELECT sum(coalesce(n_live_tup, 0)) as n_live_tup FROM pg_stat_user_tables",
101+
"SELECT coalesce(sum(n_live_tup), 0) as n_live_tup FROM pg_stat_user_tables",
102102
)
103103
}

0 commit comments

Comments
 (0)