anonymousland-synapse/synapse/storage/databases/main
Richard van der Hoff 75fb10ee45
Clean up schema for event_edges (#12893)
* Remove redundant references to `event_edges.room_id`

We don't need to care about the room_id here, because we are already checking
the event id.

* Clean up the event_edges table

We make a number of changes to `event_edges`:

 * We give the `room_id` and `is_state` columns defaults (null and false
   respectively) so that we can stop populating them.
 * We drop any rows that have `is_state` set true - they should no longer
   exist.
 * We drop any rows that do not exist in `events` - these should not exist
   either.
 * We drop the old unique constraint on all the colums, which wasn't much use.
 * We create a new unique index on `(event_id, prev_event_id)`.
 * We add a foreign key constraint to `events`.

These happen rather differently depending on whether we are on Postgres or
SQLite. For SQLite, we just rebuild the whole table, copying only the rows we
want to keep. For Postgres, we try to do things in the background as much as
possible.

* Stop populating `event_edges.room_id` and `is_state`

We can just rely on the defaults.
2022-06-15 12:29:42 +01:00
..
__init__.py Replace noop background updates with DELETE. (#12954) 2022-06-13 14:06:27 -04:00
account_data.py Use the ignored_users table to test event visibility & sync. (#12225) 2022-03-15 14:06:05 -04:00
appservice.py Remove code which updates application_services_state.last_txn (#12680) 2022-05-17 11:07:18 +01:00
cache.py Add index to cache invalidations (#12747) 2022-05-17 09:34:59 +00:00
censor_events.py Type hint the constructors of the data store classes (#11555) 2021-12-13 17:05:00 +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 Replace noop background updates with DELETE. (#12954) 2022-06-13 14:06:27 -04:00
devices.py Replace noop background updates with DELETE. (#12954) 2022-06-13 14:06:27 -04: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 Add support for MSC3202: sending one-time key counts and fallback key usage states to Application Services. (#11617) 2022-02-24 17:55:45 +00:00
event_federation.py Stop reading from event_edges.room_id. (#12914) 2022-05-31 13:51:49 +01:00
event_push_actions.py Avoid attempting to delete push actions for remote users. (#12879) 2022-05-26 07:09:16 -04:00
events_bg_updates.py Clean up schema for event_edges (#12893) 2022-06-15 12:29:42 +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 Stop reading from event_edges.room_id. (#12914) 2022-05-31 13:51:49 +01:00
events.py Clean up schema for event_edges (#12893) 2022-06-15 12:29:42 +01: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 LockStore: fix acquiring a lock via LockStore.try_acquire_lock (#12832) 2022-05-30 09:41:13 +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 Add storage and module API methods to get monthly active users and their appservices (#12838) 2022-05-27 10:25:57 +00:00
openid.py Add type hints to some storage classes (#11307) 2021-11-11 08:47:31 -05:00
presence.py Reduce DB load of /sync when using presence (#12885) 2022-05-31 13:01:05 +00:00
profile.py Remove remaining pieces of groups code. (#12966) 2022-06-06 13:20:05 -04:00
purge_events.py Clean up schema for event_edges (#12893) 2022-06-15 12:29:42 +01:00
push_rule.py Misc clean-up of push rules datastore (#12856) 2022-05-25 07:49:12 -04:00
pusher.py Fix invite notifications for users without pushers (#12840) 2022-05-30 13:14:43 +02:00
receipts.py Use READ COMMITTED isolation level when inserting read receipts (#12957) 2022-06-09 09:44:16 +01:00
registration.py Replace noop background updates with DELETE. (#12954) 2022-06-13 14:06:27 -04:00
rejections.py Remove redundant "coding: utf-8" lines (#9786) 2021-04-14 15:34:27 +01:00
relations.py Fix caching behavior for relations push rules. (#12859) 2022-05-25 07:49:54 -04:00
room_batch.py Correct type hint for room_batch.py (#11310) 2021-11-11 16:49:28 +00:00
room.py Faster joins: add issue links to the TODOs (#13004) 2022-06-09 10:13:03 +00:00
roommember.py Reduce state pulled from DB due to sending typing and receipts over federation (#12964) 2022-06-06 16:46:11 +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_deltas.py Wait for lazy join to complete when getting current state (#12872) 2022-06-01 16:02:53 +01:00
state.py Faster joins: add issue links to the TODOs (#13004) 2022-06-09 10:13:03 +00:00
stats.py Replace noop background updates with DELETE. (#12954) 2022-06-13 14:06:27 -04:00
stream.py Fix 404 on /sync when the last event is a redaction of an unknown/purged event (#12905) 2022-06-01 11:29:51 +00:00
tags.py Add some type hints to datastore (#12423) 2022-04-12 11:54:00 +01:00
transactions.py Add admin API to get a list of federated rooms (#11658) 2022-01-25 16:11:40 +00: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