Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add table for ignored users to make calculating push rules faster for large rooms. #9022

Closed
erikjohnston opened this issue Jan 5, 2021 · 2 comments · Fixed by #9024
Closed
Assignees
Labels
A-Performance Performance, both client-facing and admin-facing

Comments

@erikjohnston
Copy link
Member

For large rooms we spend quite a lot of time figuring out if anyone ignores the user:

for uid, rules in rules_by_user.items():
if event.sender == uid:
continue
if not event.is_state():
is_ignored = await self.store.is_ignored_by(event.sender, uid)
if is_ignored:
continue

which will look up the account data for each uid user. We can make this way more efficient by having a separate table for ignored users (updated when the account data is updated), which would allow us to do a single query to figure out everyone who ignores event.sender.

(The table should be quite small since few people are ignored)

@erikjohnston erikjohnston added the A-Performance Performance, both client-facing and admin-facing label Jan 5, 2021
@clokep
Copy link
Member

clokep commented Jan 5, 2021

This should be pretty straightforward to do for new data, but we would need to handle migrated current data into this form. We'll also need to figure out what to do with invalid account data, but likely we can just say that no one is ignored in that case.

@erikjohnston
Copy link
Member Author

We'll also need to figure out what to do with invalid account data, but likely we can just say that no one is ignored in that case.

That's what we do currently fwiw

@clokep clokep self-assigned this Jan 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants