synapse-product/synapse/storage/schema
Erik Johnston 0d1d3e0708
Speed up get_unread_event_push_actions_by_room (#13005)
Fixes #11887 hopefully.

The core change here is that `event_push_summary` now holds a summary of counts up until a much more recent point, meaning that the range of rows we need to count in `event_push_actions` is much smaller.

This needs two major changes:
1. When we get a receipt we need to recalculate `event_push_summary` rather than just delete it
2. The logic for deleting `event_push_actions` is now divorced from calculating `event_push_summary`.

In future it would be good to calculate `event_push_summary` while we persist a new event (it should just be a case of adding one to the relevant rows in `event_push_summary`), as that will further simplify the get counts logic and remove the need for us to periodically update `event_push_summary` in a background job.
2022-06-15 15:17:14 +00:00
..
common Support for database schema version ranges (#9933) 2021-06-11 14:45:53 +01:00
main Speed up get_unread_event_push_actions_by_room (#13005) 2022-06-15 15:17:14 +00:00
state Add a unique index to state_group_edges to prevent duplicates being accidentally introduced and the consequential impact to performance. (#12687) 2022-05-19 14:16:49 +01:00
__init__.py Clean up schema for event_edges (#12893) 2022-06-15 12:29:42 +01:00
README.md update links to schema doc (#10620) 2021-08-17 10:45:35 +00:00

Synapse Database Schemas

This directory contains the schema files used to build Synapse databases. For more information, see https://matrix-org.github.io/synapse/develop/development/database_schema.html.