summaryrefslogtreecommitdiff
path: root/src/database/database.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-08-26 17:40:54 +0200
committerlouiz’ <louiz@louiz.org>2017-08-26 17:42:59 +0200
commit2c717d347d796a2b007331c42d78146e156eaea0 (patch)
treef9143de9de6d8b0470c527df6118f2270c0e1cd9 /src/database/database.cpp
parent655151d88a6ab948949b73682c3a76a0274eb10c (diff)
downloadbiboumi-2c717d347d796a2b007331c42d78146e156eaea0.tar.gz
biboumi-2c717d347d796a2b007331c42d78146e156eaea0.tar.bz2
biboumi-2c717d347d796a2b007331c42d78146e156eaea0.tar.xz
biboumi-2c717d347d796a2b007331c42d78146e156eaea0.zip
Add an index for the muc_log_line table
This immensely speeds up the archive select queries. fix #3292
Diffstat (limited to 'src/database/database.cpp')
-rw-r--r--src/database/database.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp
index 0f2349d..f706528 100644
--- a/src/database/database.cpp
+++ b/src/database/database.cpp
@@ -6,6 +6,8 @@
#include <utils/get_first_non_empty.hpp>
#include <utils/time.hpp>
+#include <database/index.hpp>
+
#include <sqlite3.h>
sqlite3* Database::db;
@@ -42,6 +44,7 @@ void Database::open(const std::string& filename)
Database::irc_channel_options.upgrade(Database::db);
Database::roster.create(Database::db);
Database::roster.upgrade(Database::db);
+ create_index<Database::Owner, Database::IrcChanName, Database::IrcServerName>(Database::db, "archive_index", Database::muc_log_lines.get_name());
}