Remove redundant COALESCE()s around COUNT()s in database queries (#11570)

`COUNT()` never returns `NULL`. A `COUNT(*)` over 0 rows is 0 and a
`COUNT(NULL)` is also 0.
This commit is contained in:
Sean Quah 2021-12-14 12:34:30 +00:00 committed by GitHub
parent 33abbc3278
commit a4dce5b53d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 21 deletions

View file

@ -217,7 +217,7 @@ class RoomWorkerStore(SQLBaseStore):
sql = """
SELECT
COALESCE(COUNT(*), 0)
COUNT(*)
FROM (
%(published_sql)s
) published