summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-30 15:58:07 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2019-08-30 15:58:07 +0100
commit7b977bdf55d472b729ac7a302069557fe0f28768 (patch)
treece77e22900ac03f5c639c67a7e93d9fc5a083cc0
parentWhoopsies; these things come in order… (diff)
downloadsynapse-7b977bdf55d472b729ac7a302069557fe0f28768.tar.xz
Fixes to counting and stats deltas
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
-rw-r--r--synapse/storage/stats.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py

index ba7c3d25e8..7bf729c9d8 100644 --- a/synapse/storage/stats.py +++ b/synapse/storage/stats.py
@@ -951,7 +951,7 @@ class StatsStore(StateDeltasStore): dest_current_row = self._simple_select_one_txn( txn, into_table, - keyvalues, + keyvalues={ **keyvalues, **extra_dst_keyvalues }, retcols=list(chain(additive_relatives.keys(), copy_columns)), allow_none=True, ) @@ -1059,10 +1059,10 @@ class StatsStore(StateDeltasStore): new_bytes_expression = "LENGTH(CAST(json AS BLOB))" sql = """ - SELECT room_id, COUNT(*) AS new_events, SUM(%s) AS new_bytes + SELECT events.room_id, COUNT(*) AS new_events, SUM(%s) AS new_bytes FROM events INNER JOIN event_json USING (event_id) WHERE ? %s stream_ordering AND stream_ordering %s ? - GROUP BY room_id + GROUP BY events.room_id """ % ( new_bytes_expression, low_comparator,