mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 10:24:57 -04:00
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:
parent
33abbc3278
commit
a4dce5b53d
9 changed files with 20 additions and 21 deletions
|
@ -390,7 +390,7 @@ class RelationsWorkerStore(SQLBaseStore):
|
|||
latest_event_id = row[0]
|
||||
|
||||
sql = """
|
||||
SELECT COALESCE(COUNT(event_id), 0)
|
||||
SELECT COUNT(event_id)
|
||||
FROM event_relations
|
||||
INNER JOIN events USING (event_id)
|
||||
WHERE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue