Fix background update for sliding sync (find previous membership) (v2)#17632
Merged
erikjohnston merged 3 commits intodevelopfrom Aug 29, 2024
Merged
Fix background update for sliding sync (find previous membership) (v2)#17632erikjohnston merged 3 commits intodevelopfrom
erikjohnston merged 3 commits intodevelopfrom
Conversation
| ORDER BY event_stream_ordering DESC | ||
| AND m.user_id = ? | ||
| AND e.stream_ordering < ? | ||
| ORDER BY e.stream_ordering DESC |
| SELECT event_id, membership | ||
| FROM room_memberships | ||
| FROM room_memberships AS m | ||
| INNER JOIN events AS e USING (room_id, event_id) |
Contributor
There was a problem hiding this comment.
Just double-checking that looking it up this way isn't slow vs just by (event_id)
The events table does have "events_room_stream" btree (room_id, stream_ordering) so I think this could work fast.
Member
Author
There was a problem hiding this comment.
Yeah, empirically seems fast. Also helped by the fact these rooms should have very few events in them (generally just an invite then rejection)
MadLittleMods
approved these changes
Aug 29, 2024
erikjohnston
added a commit
that referenced
this pull request
Aug 30, 2024
Follow-up to #17631 and #17632 to fix-up #17599 --------- Co-authored-by: Eric Eastwood <[email protected]>
This was referenced Sep 1, 2024
erikjohnston
added a commit
that referenced
this pull request
Sep 5, 2024
erikjohnston
added a commit
that referenced
this pull request
Sep 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts commit ab414f2.
Introduced in #17512