mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:26:09 -04:00
Replace some calls to cursor_to_dict
cursor_to_dict can be surprisinglh expensive for large result sets, so lets only call it when we need to.
This commit is contained in:
parent
e71940aa64
commit
d58b1ffe94
3 changed files with 13 additions and 39 deletions
|
@ -342,10 +342,10 @@ class StateStore(SQLBaseStore):
|
|||
args.extend(where_args)
|
||||
|
||||
txn.execute(sql % (where_clause,), args)
|
||||
rows = self.cursor_to_dict(txn)
|
||||
for row in rows:
|
||||
key = (row["type"], row["state_key"])
|
||||
results[group][key] = row["event_id"]
|
||||
for row in txn:
|
||||
typ, state_key, event_id = row
|
||||
key = (typ, state_key)
|
||||
results[group][key] = event_id
|
||||
else:
|
||||
if types is not None:
|
||||
where_clause = "AND (%s)" % (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue