# HG changeset patch # User Kim Alvefur # Date 1584907559 -3600 # Node ID 3fce670e073300889a08c354e26287d6d4d2a111 # Parent fd77b6cec38db737a6987168bcc0b20f33949254 mod_storage_sql: Add index covering sort_id to improve performance (fixes #1505) diff -r fd77b6cec38d -r 3fce670e0733 plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Sun Mar 22 17:35:26 2020 +0100 +++ b/plugins/mod_storage_sql.lua Sun Mar 22 21:05:59 2020 +0100 @@ -500,6 +500,7 @@ Index { name="prosodyarchive_index", unique = engine.params.driver ~= "MySQL", "host", "user", "store", "key" }; Index { name="prosodyarchive_with_when", "host", "user", "store", "with", "when" }; Index { name="prosodyarchive_when", "host", "user", "store", "when" }; + Index { name="prosodyarchive_sort", "host", "user", "store", "sort_id" }; }; engine:transaction(function() ProsodyArchiveTable:create(engine);