forked-synapse/synapse/storage/schema/main/delta
Nick Mills-Barrett e6af49fbea
Reintroduce membership tables event stream ordering (#15128)
* Add `event_stream_ordering` column to membership state tables

Specifically this adds the column to `current_state_events`,
`local_current_membership` and `room_memberships`. Each of these tables
is regularly joined with the `events` table to get the stream ordering
and denormalising this into each table will yield significant query
performance improvements once used.

* Make denormalised `event_stream_ordering` columns foreign keys
* Add comment in schema file explaining new denormalised columns
* Add triggers to enforce consistency of `event_stream_ordering` columns
* Re-order purge room tables to account for foreign keys
* Bump schema version to 75

Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-03-24 11:44:01 +00:00
..
12
13
14
15
16
17
18
19
20
21
22
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 Speed up get_unread_event_push_actions_by_room (#13005) 2022-06-15 15:17:14 +00:00
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
67
68
69
70 Rename delta to apply in the proper schema version. (#13050) 2022-06-14 14:34:04 +00:00
71 Speed up get_unread_event_push_actions_by_room (#13005) 2022-06-15 15:17:14 +00:00
72 Update event push action and receipt tables to support threads. (#13753) 2022-09-14 17:11:16 +00:00
73 Revert "Add event_stream_ordering column to membership state tables (#14979)" 2023-02-07 15:26:55 +00:00
74 Reintroduce membership tables event stream ordering (#15128) 2023-03-24 11:44:01 +00:00