element-hq / element-hq/synapse

Improve the performance of fetching event reports over the admin API when there are many of them and the requester has paginated far down the list.

Open
#16,620 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

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

---

Partial fix to #16619

General idea: defer the join to `events` until after the offset has been applied. It's hard to get an unbiased measurement for this, but the old query took ~3s and the new query took ~500ms for a given query (identical results).

It'd be nicer to add proper indices and defer the other join too (and even change the pagination scheme to not use OFFSET), but this is all I had for a drive-by improvement.

Base: `develop`

Original commit schedule, with full messages:


  1. Improve performance of fetching event reports when there are many of them


Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.