-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Reintroduce membership tables event stream ordering #15128
Reintroduce membership tables event stream ordering #15128
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be bumping SCHEMA_VERSION
to 74 here
SCHEMA_VERSION = 73 # remember to update the list below when updating |
(with a comment explaining what's changed in version 74), but leave SCHEMA_COMPAT_VERSION at 73.
Argh can't believe I missed this! @DMRobertson I think this should be bumping the compat version now? Once this is applied the schema cannot be rolled back before 74. 6901682 |
Err, I think I got SCHEMA_VERSION and SCHEMA_COMPAT_VERSION mixed up. I also completely forgot about #15036. (It seems the local branch I used to generate that link is a little out of date 🤦)
Agreed: as of this change, Synapse needs to make disambiguated queries. |
Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane to me, but it might be worth a second pair of eyes since we messed up last time.
synapse/storage/schema/main/delta/74/01membership_tables_event_stream_ordering.sql
Outdated
Show resolved
Hide resolved
synapse/storage/schema/main/delta/74/01membership_tables_event_stream_ordering.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: David Robertson <david.m.robertson1@gmail.com>
…bership tables" This reverts commit da71761.
Concerns addressed and background update part removed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm other than typo
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This reverts commit e6af49f.
…atrix-org#15128)" (matrix-org#15347)" This reverts commit 5350b5d.
…atrix-org#15128)" (matrix-org#15347)" This reverts commit 5350b5d.
Reintroduces #14979 with fixes per #15014.
Original description:
This adds an
event_stream_ordering
column tocurrent_state_events
,local_current_membership
androom_memberships
. Each of these tables is regularly joined with theevents
table to get the stream ordering and denormalising this into each table will yield significant query performance improvements once used.Includes a background job to populate these values from thepushed back for now.events
tableSame idea as #13703 which has been a significant improvement on our database instance, suspect once applied this will be far greater.
Signed off by Nick @ Beeper (@Fizzadar).
Pull Request Checklist
(run the linters)
Closes: #15014