From b923d364ed8616b68efe0e4c26eee7a288185632 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 19 Aug 2016 16:26:27 +0100 Subject: [PATCH] Indexes! --- src/github.com/matrix-org/go-neb/database/schema.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/github.com/matrix-org/go-neb/database/schema.go b/src/github.com/matrix-org/go-neb/database/schema.go index c2e8260..892882b 100644 --- a/src/github.com/matrix-org/go-neb/database/schema.go +++ b/src/github.com/matrix-org/go-neb/database/schema.go @@ -18,6 +18,7 @@ CREATE TABLE IF NOT EXISTS services ( time_updated_ms BIGINT NOT NULL, UNIQUE(service_id) ); +CREATE UNIQUE INDEX IF NOT EXISTS service_id_and_user_idx ON services(service_user_id, service_id); CREATE TABLE IF NOT EXISTS matrix_clients ( user_id TEXT NOT NULL,