summary refs log tree commit diff
path: root/synapse/storage/schema
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-11-11 10:45:46 +0000
committerGitHub <noreply@github.com>2024-11-11 10:45:46 +0000
commitc486ec8bc24460d86e23e174b13839875c382ed4 (patch)
tree979c25c161c1b87b3a4626e83f32775df6d8fd64 /synapse/storage/schema
parentUpdate changelog for release (diff)
downloadsynapse-c486ec8bc24460d86e23e174b13839875c382ed4.tar.xz
Add index to `current_state_delta_stream` (#17912)
As we're now using it in the sync APIs to get state changes within a
room
Diffstat (limited to 'synapse/storage/schema')
-rw-r--r--synapse/storage/schema/main/delta/88/04_current_state_delta_index.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/synapse/storage/schema/main/delta/88/04_current_state_delta_index.sql b/synapse/storage/schema/main/delta/88/04_current_state_delta_index.sql
new file mode 100644

index 0000000000..ad54302a8f --- /dev/null +++ b/synapse/storage/schema/main/delta/88/04_current_state_delta_index.sql
@@ -0,0 +1,18 @@ +-- +-- This file is licensed under the Affero General Public License (AGPL) version 3. +-- +-- Copyright (C) 2024 New Vector, Ltd +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- See the GNU Affero General Public License for more details: +-- <https://www.gnu.org/licenses/agpl-3.0.html>. + + +-- Add an index on (user_id, device_id, algorithm, ts_added_ms) on e2e_one_time_keys_json, so that OTKs can +-- efficiently be issued in the same order they were uploaded. +INSERT INTO background_updates (ordering, update_name, progress_json) VALUES + (8804, 'current_state_delta_stream_room_index', '{}');