From fd5fc90cc4578ed93fe507a8fc2cb9392cc957c4 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Mon, 31 Jul 2017 16:20:07 +0100 Subject: [PATCH] Add database index for data retrieval --- .../matrix-org/dendrite/syncapi/storage/account_data_table.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/github.com/matrix-org/dendrite/syncapi/storage/account_data_table.go b/src/github.com/matrix-org/dendrite/syncapi/storage/account_data_table.go index c51cfd19a..1668d995f 100644 --- a/src/github.com/matrix-org/dendrite/syncapi/storage/account_data_table.go +++ b/src/github.com/matrix-org/dendrite/syncapi/storage/account_data_table.go @@ -37,6 +37,8 @@ CREATE TABLE IF NOT EXISTS account_data_type ( -- We don't want two entries of the same type for the same user CONSTRAINT account_data_unique UNIQUE (user_id, room_id, type) ); + +CREATE UNIQUE INDEX IF NOT EXISTS account_data_id_idx ON account_data(id); ` const insertAccountDataSQL = "" +