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

Refactor state group lookup to reduce DB hits #4011

Merged
merged 38 commits into from
Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8f5e9f8
Refactor state group lookup to reduce DB hits
erikjohnston Oct 5, 2018
0a94c2f
Newsfile
erikjohnston Oct 5, 2018
24ac0f7
Fix up docs, variable names and style
erikjohnston Oct 10, 2018
63f944d
Rewrite to use new StateFilter internally
erikjohnston Oct 11, 2018
a0f966b
Move filtering logic to StateFilter
erikjohnston Oct 12, 2018
e8d92e9
Fix up comment
erikjohnston Oct 24, 2018
4f1b299
Just use normal string concatenation
erikjohnston Oct 24, 2018
aa251f9
Add missing 'is not None'
erikjohnston Oct 24, 2018
93265c8
Refactor to use StateFilter everywhere
erikjohnston Oct 24, 2018
f1480c6
User StateFilter for fetching from caches
erikjohnston Oct 24, 2018
a4b6066
Refactor StateFilter to be cleaner
erikjohnston Oct 24, 2018
6033ff5
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/st…
erikjohnston Oct 24, 2018
c189b72
Remove debug logging
erikjohnston Oct 24, 2018
9518712
Move comment
erikjohnston Oct 24, 2018
16e7bd0
Fix docstring typo
richvdh Oct 25, 2018
49d0cb5
Fix up docstring
richvdh Oct 25, 2018
245e22f
Fix up docstring
richvdh Oct 25, 2018
9afdb13
Fix up docstring
richvdh Oct 25, 2018
85fcd82
Fix up docstring
richvdh Oct 25, 2018
b3e4493
Fix up docstring
richvdh Oct 25, 2018
1362505
Fix up docstring
richvdh Oct 25, 2018
f29af2d
Fix using sum rather than len
richvdh Oct 25, 2018
780960c
Add docstring
erikjohnston Oct 25, 2018
36edf79
Canonicalise types dict when include_others=True
erikjohnston Oct 25, 2018
315e75d
Fix up overzealous iteration
erikjohnston Oct 25, 2018
75bd67e
Fix up comment
erikjohnston Oct 25, 2018
ddbe779
Don't needlessly copy
erikjohnston Oct 25, 2018
bb6bc6e
Drop default
erikjohnston Oct 25, 2018
7f7f7ae
Clarify by moving blank line
erikjohnston Oct 25, 2018
9055583
Clean up comment
erikjohnston Oct 25, 2018
630dc7c
Neaten up adding where clause to sql
erikjohnston Oct 25, 2018
eb6d3c9
Use from_types helper func
erikjohnston Oct 25, 2018
cf984c0
Add from_lazy_load_member_list
erikjohnston Oct 25, 2018
2bdee39
Correctly handle empty filters in make_sql_filter_clause
erikjohnston Oct 25, 2018
283e021
Tidy up return_expanded
erikjohnston Oct 25, 2018
36408bc
Always use helper functions rather than init
erikjohnston Oct 25, 2018
d701ef6
Move __attrs_post_init__ to top
erikjohnston Oct 25, 2018
f189fd4
Doc when an empty SQL string means in make_sql_filter_clause
erikjohnston Oct 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/4011.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduce database load when fetching state groups
2 changes: 1 addition & 1 deletion synapse/storage/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ def _purge_history_txn(
for sg in remaining_state_groups:
logger.info("[purge] de-delta-ing remaining state group %s", sg)
curr_state = self._get_state_groups_from_groups_txn(
txn, [sg], types=None
txn, [sg],
)
curr_state = curr_state[sg]

Expand Down
Loading