From e89fea4f04c6fc7df41c5cade63609b513a98073 Mon Sep 17 00:00:00 2001
From: Jason Robinson <jasonr@matrix.org>
Date: Mon, 9 Sep 2019 16:43:32 +0300
Subject: [PATCH] Simplify count_real_users SQL to only count user_type is null
 rows

Signed-off-by: Jason Robinson <jasonr@matrix.org>
---
 synapse/storage/registration.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index 54b0846c54..c0ca25733b 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -450,7 +450,7 @@ class RegistrationWorkerStore(SQLBaseStore):
 
         def _count_users(txn):
             txn.execute(
-                "SELECT COUNT(*) AS users FROM users where user_type is null or user_type = ''"
+                "SELECT COUNT(*) AS users FROM users where user_type is null"
             )
             rows = self.cursor_to_dict(txn)
             if rows:
-- 
GitLab