This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Drop state_events
and rejections
tables
#11496
Labels
A-Database
DB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the db
T-Task
Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Z-Future-Maintenance
Things that can't yet be done, but will need cleaning up in a couple of months/releases
Both
state_events
andrejections
are tables which add a single piece of data to a subset of events (state_key
andreason
, respectively).I believe this would better handled with nullable columns in the
events
table:state_events
andrejections
are never read from without a join toevents
, so we can save a join whereever we read from themevents
is going to transform it from a small, cacheable table to something huge (so I don't expect much difference in the case where we don't join torejections
orstate_events
). In any case, when we look inevents
we normally want the rejection status too.However, getting from here to there is not an easy task by any means, and will take quite a bit of work to do in a way that doesn't break backwards compatibility. Here are the tasks as far as I can see them:
state_key
column, in preparation for adding new columns toevents
: Disambiguate queries onstate_key
#11497state_key
andrejection_reason
columns toevents
, and populate them for all new events: Addstate_key
andrejection_reason
toevents
#11792state_key
andrejection_reason
for all existing events: Bg update to populate newevents
table columns #13215Each of those steps will require SCHEMA_VERSION and/or SCHEMA_COMPAT version updates to ensure that we never break compatibility with the previous Synapse release.
The text was updated successfully, but these errors were encountered: