element-hq / element-hq/synapse
Fetching event reports can be slow
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#16619](https://github.com/matrix-org/synapse/issues/16619).
---
E.g. from Jaeger:


My money is on LIMIT ... OFFSET ... being slow. I wonder if we could change this to paginate without OFFSET using the `id` column? (I assume that `received_ts` increases as `id` increases, and vice versa).
Contributor guide
Research direction
The issue provides Jaeger traces but no source file or test. Start by locating the event-report fetch query and reviewing the traces; compare the current LIMIT/OFFSET path with id-based pagination. Done means the reported event-report fetch latency is addressed and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- backend, databases, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100