Skip to content
Snippets Groups Projects
Commit 33d2d82f authored by Erik Johnston's avatar Erik Johnston
Browse files

In get_state_groups, get the full event json rather than just the event_ids so...

In get_state_groups, get the full event json rather than just the event_ids so we don't have to do so many db queries
parent d3d0713d
No related branches found
No related tags found
No related merge requests found
...@@ -60,14 +60,19 @@ class StateStore(SQLBaseStore): ...@@ -60,14 +60,19 @@ class StateStore(SQLBaseStore):
res = {} res = {}
for group in groups: for group in groups:
state_ids = self._simple_select_onecol_txn( sql = (
txn, "SELECT internal_metadata, json, r.event_id "
table="state_groups_state", "FROM event_json as e "
keyvalues={"state_group": group}, "INNER JOIN state_groups_state as s "
retcol="event_id", "ON e.event_id = s.event_id "
"LEFT JOIN redactions as r ON e.event_id = r.redacts "
"WHERE s.state_group = ?"
) )
state = self._get_events_txn(txn, state_ids) txn.execute(sql, (group,))
rows = txn.fetchall()
state = [self._get_event_from_row_txn(txn, *r) for r in rows]
res[group] = state res[group] = state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment