Commit 96f9fbc2 authored by Philipp Hörist's avatar Philipp Hörist

Database: Add index on the message_id column

parent 5aff9fb0
Pipeline #4434 passed with stages
in 2 minutes and 53 seconds
......@@ -95,7 +95,8 @@ LOGS_SQL_STATEMENT = '''
);
CREATE INDEX idx_logs_jid_id_time ON logs (jid_id, time DESC);
CREATE INDEX idx_logs_stanza_id ON logs (stanza_id);
PRAGMA user_version=4;
CREATE INDEX idx_logs_message_id ON logs (message_id);
PRAGMA user_version=5;
'''
CACHE_SQL_STATEMENT = '''
......@@ -328,6 +329,13 @@ class Logger:
]
self._execute_multiple(con, statements)
if self._get_user_version(con) < 5:
statements = [
'CREATE INDEX idx_logs_message_id ON logs (message_id)',
'PRAGMA user_version=5'
]
self._execute_multiple(con, statements)
def _migrate_cache(self, con):
if self._get_user_version(con) == 0:
# All migrations from 0.16.9 until 1.0.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment