MatrixSynapse/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
appservice.py
cache.py
censor_events.py
client_ips.py
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
e2e_room_keys.py
end_to_end_keys.py
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.py Clean up schema for `event_edges` (#12893) 2022-06-15 12:29:42 +01:00
events_bg_updates.py Clean up schema for `event_edges` (#12893) 2022-06-15 12:29:42 +01:00
events_forward_extremities.py
events_worker.py Stop reading from `event_edges.room_id`. (#12914) 2022-05-31 13:51:49 +01:00
filtering.py
keys.py
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
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
relations.py Fix caching behavior for relations push rules. (#12859) 2022-05-25 07:49:54 -04:00
room.py Faster joins: add issue links to the TODOs (#13004) 2022-06-09 10:13:03 +00:00
room_batch.py
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
signatures.py
state.py Faster joins: add issue links to the TODOs (#13004) 2022-06-09 10:13:03 +00: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 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
transactions.py
ui_auth.py
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