summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-12 14:30:53 +0000
committerErik Johnston <erik@matrix.org>2014-11-12 14:33:48 +0000
commit58c0ef90c9e723697076fe419fa1e2cfa1000fd3 (patch)
tree2e7c3ea4f71d83815fbd4a42d24f6ab5055805b7
parentSYWEB-57: Highlight rooms where the history has changed. (diff)
downloadsynapse-58c0ef90c9e723697076fe419fa1e2cfa1000fd3.tar.xz
Add indices to state group tables
-rw-r--r--synapse/storage/schema/state.sql13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/schema/state.sql b/synapse/storage/schema/state.sql

index b44c56b519..44f7aafb27 100644 --- a/synapse/storage/schema/state.sql +++ b/synapse/storage/schema/state.sql
@@ -30,4 +30,17 @@ CREATE TABLE IF NOT EXISTS state_groups_state( CREATE TABLE IF NOT EXISTS event_to_state_groups( event_id TEXT NOT NULL, state_group INTEGER NOT NULL +); + +CREATE INDEX IF NOT EXISTS state_groups_id ON state_groups(id); + +CREATE INDEX IF NOT EXISTS state_groups_state_id ON state_groups_state( + state_group +); +CREATE INDEX IF NOT EXISTS state_groups_state_tuple ON state_groups_state( + room_id, type, state_key +); + +CREATE INDEX IF NOT EXISTS event_to_state_groups_id ON event_to_state_groups( + event_id ); \ No newline at end of file