mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-23 03:44:07 -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
|
@ -538,7 +538,7 @@ class StatsStore(StateDeltasStore):
|
|||
|
||||
txn.execute(
|
||||
"""
|
||||
SELECT COALESCE(count(*), 0) FROM current_state_events
|
||||
SELECT COUNT(*) FROM current_state_events
|
||||
WHERE room_id = ?
|
||||
""",
|
||||
(room_id,),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue