0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-11-09 03:11:27 +01:00
dendrite/roomserver/storage/sqlite3
Till eb29a31550
Optimize /sync and history visibility (#2961)
Should fix the following issues or make a lot less worse when using
Postgres:

The main issue behind #2911: The client gives up after a certain time,
causing a cascade of context errors, because the response couldn't be
built up fast enough. This mostly happens on accounts with many rooms,
due to the inefficient way we're getting recent events and current state

For #2777: The queries for getting the membership events for history
visibility were being executed for each room (I think 185?), resulting
in a whooping 2k queries for membership events. (Getting the
statesnapshot -> block nids -> actual wanted membership event)

Both should now be better by:
- Using a LATERAL join to get all recent events for all joined rooms in
one go (TODO: maybe do the same for room summary and current state etc)
- If we're lazy loading on initial syncs, we're now not getting the
whole current state, just to drop the majority of it because we're lazy
loading members - we add a filter to exclude membership events on the
first call to `CurrentState`.
- Using an optimized query to get the membership events needed to
calculate history visibility

---------

Co-authored-by: kegsay <kegan@matrix.org>
2023-02-07 14:31:23 +01:00
..
deltas Fix SQLite roomserver_published migration 2022-11-01 16:08:13 +00:00
event_json_table.go Add roomserver tests (1/?) (#2434) 2022-05-09 15:30:32 +02:00
event_state_keys_table.go Add roomserver tests (1/?) (#2434) 2022-05-09 15:30:32 +02:00
event_types_table.go Add roomserver tests (1/?) (#2434) 2022-05-09 15:30:32 +02:00
events_table.go Optimize history visibility checks (#2848) 2022-11-01 15:07:17 +00:00
invite_table.go Fix issue with DMs shown as normal rooms (#2776) 2022-10-07 16:00:12 +02:00
membership_table.go Cleanup stale device lists for users we don't share a room with anymore (#2857) 2022-12-12 08:20:59 +01:00
previous_events_table.go Add roomserver tests (2/?) (#2445) 2022-05-10 14:41:12 +02:00
published_table.go Add AS specific public room list endpoints (#2836) 2022-10-27 14:40:35 +02:00
purge_statements.go Add /_dendrite/admin/purgeRoom/{roomID} (#2662) 2023-01-19 21:02:32 +01:00
redactions_table.go Add roomserver tests (2/?) (#2445) 2022-05-10 14:41:12 +02:00
room_aliases_table.go Add roomserver tests (3/4) (#2447) 2022-05-16 19:33:16 +02:00
rooms_table.go Add /_dendrite/admin/purgeRoom/{roomID} (#2662) 2023-01-19 21:02:32 +01:00
state_block_table.go Add /_dendrite/admin/purgeRoom/{roomID} (#2662) 2023-01-19 21:02:32 +01:00
state_snapshot_table.go Optimize /sync and history visibility (#2961) 2023-02-07 14:31:23 +01:00
storage.go Add /_dendrite/admin/purgeRoom/{roomID} (#2662) 2023-01-19 21:02:32 +01:00