element-hq / element-hq/synapse

Use receipts `event_stream_ordering` column, remove joins to `events`

Open
#13,918 0 comments 0 reactions 0 assignees View on GitHub
X-Awaiting-Changes
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#13918](https://github.com/matrix-org/synapse/pull/13918).

---

Follow up to: https://github.com/matrix-org/synapse/commit/cdbb6412327b542e0dead792717fe58253291131

This relies on the completion of the background task introduced by the above change. I suggest that we leave this in draft for N(?) releases and then force the migration similar to https://github.com/matrix-org/synapse/commit/da41a7cd618d11b05c2c04c39068fd4b1e1b7894#diff-ddb3c5844daede09acca491cc04a3740730179fca1fa75aa25b921727209947a, probably with an appropriate upgrade note at the time.

Signed off by Nick @ Beeper (@fizzadar).

### Pull Request Checklist

* [x] Pull request is based on the develop branch
* [x] Pull request includes a [changelog file](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#changelog).
* [x] Pull request includes a [sign off](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#sign-off)
* [x] [Code style](https://matrix-org.github.io/synapse/latest/code_style.html) is correct
(run the [linters](https://matrix-org.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))

Contributor guide

Open the contributing guide

Research direction

Start by reading the referenced background-task commit and the follow-up migration commit, then trace the receipts queries that still join events. Confirm the background task has completed before changing the rollout. Done means receipts use event_stream_ordering without those joins, with an appropriate upgrade note when the migration is forced.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.