diff --git a/syncapi/storage/postgres/stats.go b/syncapi/storage/postgres/stats.go index 04ebd0a8f..2b5e1a940 100644 --- a/syncapi/storage/postgres/stats.go +++ b/syncapi/storage/postgres/stats.go @@ -85,8 +85,8 @@ func (s *statsStatements) DailyMessages(ctx context.Context, txn *sql.Tx, prevID func (s *statsStatements) DailySentMessages(ctx context.Context, txn *sql.Tx, prevID int64) (result int64, err error) { stmt := sqlutil.TxStmt(txn, s.countTypesStmt) err = stmt.QueryRowContext(ctx, - prevID, "m.room.message", + prevID, fmt.Sprintf("%%:%s", s.serverName), ).Scan(&result) return diff --git a/userapi/storage/postgres/stats_table.go b/userapi/storage/postgres/stats_table.go index 752b22ace..04a285325 100644 --- a/userapi/storage/postgres/stats_table.go +++ b/userapi/storage/postgres/stats_table.go @@ -104,7 +104,7 @@ GROUP BY client_type ` const countUserByAccountTypeSQL = ` -SELECT COUNT(*) FROM account_accounts WHERE account_type IN $1 +SELECT COUNT(*) FROM account_accounts WHERE account_type = $1 ` const countRegisteredUserByTypeStmt = `