From fa77fa5b164bb7d4fdfbe85ccc9b48ad1f95b025 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Tue, 21 Nov 2017 14:46:21 +0100
Subject: mod_storage_sql: Add indices that include the with and when columns
 of archives

---
 plugins/mod_storage_sql.lua | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index c729c66a..e25cb5c6 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -452,6 +452,8 @@ local function create_table(engine, name) -- luacheck: ignore 431/engine
 		Column { name="type", type="TEXT", nullable=false };
 		Column { name="value", type="MEDIUMTEXT", nullable=false };
 		Index { name="prosodyarchive_index", unique = true, "host", "user", "store", "key" };
+		Index { name="prosodyarchive_with", "host", "user", "store", "with" };
+		Index { name="prosodyarchive_when", "host", "user", "store", "when" };
 	};
 	engine:transaction(function()
 		ProsodyArchiveTable:create(engine);
-- 
cgit v1.2.3