synapse-old/synapse/storage/databases/main
Eric Eastwood df8b91ed2b
Limit and filter the number of backfill points to get from the database (#13879)
There is no need to grab thousands of backfill points when we only need 5 to make the `/backfill` request with. We need to grab a few extra in case the first few aren't visible in the history.

Previously, we grabbed thousands of backfill points from the database, then sorted and filtered them in the app. Fetching the 4.6k backfill points for `#matrix:matrix.org` from the database takes ~50ms - ~570ms so it's not like this saves a lot of time 🤷. But it might save us more time now that `get_backfill_points_in_room`/`get_insertion_event_backward_extremities_in_room` are more complicated after https://github.com/matrix-org/synapse/pull/13635 

This PR moves the filtering and limiting to the SQL query so we just have less data to work with in the first place.

Part of https://github.com/matrix-org/synapse/issues/13356
2022-09-28 15:26:16 -05:00
..
__init__.py Handle the case of remote users leaving a partial join room for device lists (#13885) 2022-09-27 13:01:08 +01:00
account_data.py Speed up fetching large numbers of push rules (#13592) 2022-08-23 13:15:43 +01:00
appservice.py Federation Sender & Appservice Pusher Stream Optimisations (#13251) 2022-07-15 09:36:56 +01:00
cache.py Simplify cache invalidation after event persist txn (#13796) 2022-09-26 16:26:35 +01:00
censor_events.py Safe async event cache (#13308) 2022-07-19 11:25:29 +00:00
client_ips.py Optimise `_update_client_ips_batch_txn` to batch together database operations. (#12252) 2022-04-08 15:29:13 +01:00
deviceinbox.py Add missing types to opentracing. (#13345) 2022-07-21 12:01:52 +00:00
devices.py Handle remote device list updates during partial join (#13913) 2022-09-28 13:42:43 +00:00
directory.py Replace uses of simple_insert_many with simple_insert_many_values. (#11742) 2022-01-13 19:44:18 -05:00
e2e_room_keys.py Add `StreamKeyType` class and replace string literals with constants (#12567) 2022-05-16 15:35:31 +00:00
end_to_end_keys.py Cancel the processing of key query requests when they time out. (#13680) 2022-09-07 12:03:32 +01:00
event_federation.py Limit and filter the number of backfill points to get from the database (#13879) 2022-09-28 15:26:16 -05:00
event_push_actions.py Revert "Stop returning an unused column when handling new receipts. (#13933)" (#13935) 2022-09-28 11:01:41 -04:00
events.py fix: Push notifications for invite over federation (#13719) 2022-09-28 12:31:53 +00:00
events_bg_updates.py Bg update to populate new `events` table columns (#13215) 2022-07-15 12:47:26 +01:00
events_forward_extremities.py Fix returned count of delete extremities admin API (#12496) 2022-04-19 16:49:45 +01:00
events_worker.py Fix `have_seen_event` cache not being invalidated (#13863) 2022-09-27 15:55:43 -05:00
filtering.py Improve type hints in storage classes. (#11652) 2021-12-29 13:04:28 +00:00
keys.py Add some type hints to datastore (#12485) 2022-04-27 13:05:00 +01:00
lock.py Require SQLite >= 3.27.0 (#13760) 2022-09-09 11:14:10 +01:00
media_repository.py Replace noop background updates with DELETE. (#12954) 2022-06-13 14:06:27 -04:00
metrics.py Add some type hints to datastore (#12717) 2022-05-17 15:29:06 +01:00
monthly_active_users.py Safe async event cache (#13308) 2022-07-19 11:25:29 +00:00
openid.py Add type hints to some storage classes (#11307) 2021-11-11 08:47:31 -05:00
presence.py Revert "Make all `process_replication_rows` methods async (#13304)" (#13312) 2022-07-18 14:28:14 +01:00
profile.py Remove remaining pieces of groups code. (#12966) 2022-06-06 13:20:05 -04:00
purge_events.py Add support to purge rows from MSC2716 and other tables when purging a room (#13825) 2022-09-16 10:56:56 -05:00
push_rule.py Port the push rule classes to Rust. (#13768) 2022-09-20 12:10:31 +01:00
pusher.py Track device IDs for pushers (#13831) 2022-09-21 15:31:53 +00:00
receipts.py Accept & store thread IDs for receipts (implement MSC3771). (#13782) 2022-09-23 14:33:28 +00:00
registration.py Add timestamp to user's consent (#13741) 2022-09-08 15:41:48 +00:00
rejections.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
relations.py Properly paginate forward in the /relations API. (#13840) 2022-09-22 12:47:49 +00:00
room.py Handle remote device list updates during partial join (#13913) 2022-09-28 13:42:43 +00:00
room_batch.py Correct type hint for room_batch.py (#11310) 2021-11-11 16:49:28 +00:00
roommember.py Handle the case of remote users leaving a partial join room for device lists (#13885) 2022-09-27 13:01:08 +01:00
search.py Replace noop background updates with DELETE. (#12954) 2022-06-13 14:06:27 -04:00
session.py Run `pyupgrade --py37-plus --keep-percent-format` on Synapse (#11685) 2022-01-05 09:53:05 -08:00
signatures.py remove constantly lib use and switch to enums. (#12624) 2022-05-04 11:26:11 +00:00
state.py Instrument `get_metadata_for_events` for tracing (#13730) 2022-09-07 11:41:52 -05:00
state_deltas.py Wait for lazy join to complete when getting current state (#12872) 2022-06-01 16:02:53 +01:00
stats.py Require SQLite >= 3.27.0 (#13760) 2022-09-09 11:14:10 +01:00
stream.py Properly paginate forward in the /relations API. (#13840) 2022-09-22 12:47:49 +00:00
tags.py Revert "Make all `process_replication_rows` methods async (#13304)" (#13312) 2022-07-18 14:28:14 +01:00
transactions.py Require SQLite >= 3.27.0 (#13760) 2022-09-09 11:14:10 +01:00
ui_auth.py Add some type hints to datastore (#12485) 2022-04-27 13:05:00 +01:00
user_directory.py Wait for lazy join to complete when getting current state (#12872) 2022-06-01 16:02:53 +01:00
user_erasure_store.py Annotations for user_erasure_store (#11313) 2021-11-11 19:22:19 +00:00