Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

we should kill off the event_reference_hashes table #6574

Closed
richvdh opened this issue Dec 19, 2019 · 2 comments · Fixed by #13218
Closed

we should kill off the event_reference_hashes table #6574

richvdh opened this issue Dec 19, 2019 · 2 comments · Fixed by #13218
Assignees
Labels
A-Performance Performance, both client-facing and admin-facing z-p2 (Deprecated Label)

Comments

@richvdh
Copy link
Member

richvdh commented Dec 19, 2019

as far as I can tell, the values we read from it are never used. They are dutifully passed all the way down the stack into create_new_client_event, which throws them away.

@richvdh
Copy link
Member Author

richvdh commented Jan 3, 2020

so I started on this in #6629. It turns out that event_reference_hashes is still used when building V1 events (ie, events for room_versions 1 and 2), so we can't kill it off just yet.

@richvdh
Copy link
Member Author

richvdh commented Jan 5, 2020

Thinking about this a little more: I still think we should kill off event_reference_hashes: we can replace the hash lookups for v1 event population with calculations. The reasons for this are:

  • most events are (or soon will be) not v1 events, so calculating and storing the reference hash is wasteful
  • of those that are v1 events, most are only used once or twice in references, so again: storing their hashes is wasteful. (The exception is things like the create event and PL event of busy rooms, but caching the calculation result will mitigate this)
  • Calculating reference hashes isn't that hard and if it saves waiting for a database lookup it's probably a win anyway
  • Event persistence (as opposed to creation) is a bottleneck since it's hard to parallelise, so it's good to move any work we possible can out of the event persistence path.

@neilisfragile neilisfragile added A-Performance Performance, both client-facing and admin-facing z-p2 (Deprecated Label) labels Jan 8, 2020
richvdh added a commit that referenced this issue Jan 20, 2022
Preparation for dropping this table altogether. Part of #6574.
richvdh added a commit that referenced this issue Jan 21, 2022
Preparation for dropping this table altogether. Part of #6574.
@richvdh richvdh self-assigned this Jul 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing z-p2 (Deprecated Label)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants