synapse
synapse copied to clipboard
Sliding Sync: Speed up background updates to populate Sliding Sync tables
Speed up background updates to populate Sliding Sync tables
Follow-up to https://github.com/element-hq/synapse/pull/17512
- Read from the
room_stats_statetable forroom_type,name, andis_encrypted - For joins, if the state hasn't changed since the last snapshot, use the last membership snapshot we inserted
concurrently_executeprocessing and inserting- Use batch/bulk SQL queries like
simple_upsert_many_txnwhere we can
Dev notes
The quick and dirty script that Erik wrote to run on matrix.org, https://github.com/erikjohnston/synapse-fast-bg-update/blob/main/src/main.rs
Pull Request Checklist
- [x] Pull request is based on the develop branch
- [x] Pull request includes a changelog file. The entry should:
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from
EventStoretoEventWorkerStore.". - Use markdown where necessary, mostly for
code blocks. - End with either a period (.) or an exclamation mark (!).
- Start with a capital letter.
- Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
- Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from
- [x] Code style is correct (run the linters)