diff options
author | Tobias Fella <9750016+TobiasFella@users.noreply.github.com> | 2022-03-09 20:08:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-09 20:08:38 +0100 |
commit | cbc42d892f7fcc0ef269229c5750266c544729b2 (patch) | |
tree | fc2f0f19bdcac657983672334a8d1ff9b76ae8a2 /lib | |
parent | 01f7641292eb5dff236f434d7140259c429521ca (diff) | |
download | libquotient-cbc42d892f7fcc0ef269229c5750266c544729b2.tar.gz libquotient-cbc42d892f7fcc0ef269229c5750266c544729b2.zip |
Update lib/database.cpp
Co-authored-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/database.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/database.cpp b/lib/database.cpp index 21e79d58..70dc1b9b 100644 --- a/lib/database.cpp +++ b/lib/database.cpp @@ -101,6 +101,12 @@ void Database::migrateTo2() transaction(); execute(QStringLiteral("ALTER TABLE inbound_megolm_sessions ADD ed25519Key TEXT")); execute(QStringLiteral("ALTER TABLE olm_sessions ADD lastReceived TEXT")); + + // Add indexes for improving queries speed on larger database + execute(QStringLiteral("CREATE INDEX sessions_session_idx ON olm_sessions(sessionId)")); + execute(QStringLiteral("CREATE INDEX outbound_room_idx ON outbound_megolm_sessions(roomId)")); + execute(QStringLiteral("CREATE INDEX inbound_room_idx ON inbound_megolm_sessions(roomId)")); + execute(QStringLiteral("CREATE INDEX group_session_idx ON group_session_record_index(roomId, sessionId, i)")); execute(QStringLiteral("PRAGMA user_version = 2;")); commit(); } |