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

Drop state_events and rejections tables #11496

@richvdh

Description

@richvdh

Both state_events and rejections are tables which add a single piece of data to a subset of events (state_key and reason, respectively).

I believe this would better handled with nullable columns in the events table:

  • state_events and rejections are never read from without a join to events, so we can save a join whereever we read from them
  • it's not like adding the data to events 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 to rejections or state_events). In any case, when we look in events we normally want the rejection status too.
  • obviously, populating three tables (and maintaining two extra indexes) is extra work to do when storing events.

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:

Each 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DatabaseDB stuff like queries, migrations, new/remove columns, indexes, unexpected entries in the dbT-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.Z-Future-MaintenanceThings that can't yet be done, but will need cleaning up in a couple of months/releases

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions