From 71237e02af1d6fd16978e387941565ecbe3607c7 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 6 Oct 2023 16:12:55 -0400 Subject: [PATCH] fix(moderation): added indexing to create_guild_table --- moderation/moderation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/moderation/moderation.py b/moderation/moderation.py index dbbc5ef..66c1972 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -148,6 +148,11 @@ class Moderation(commands.Cog): ) """ cursor.execute(query) + index_query = f""" + CREATE INDEX idx_target_id ON moderation_%s(target_id(25)); + CREATE INDEX idx_moderator_id ON moderation_%s(moderator_id(25)); + CREATE INDEX idx_moderation_id ON moderation_%s(moderation_id);""" + cursor.execute(index_query, (guild.id, guild.id, guild.id)) insert_query = f""" INSERT INTO `moderation_{guild.id}` (moderation_id, timestamp, moderation_type, target_id, moderator_id, duration, end_timestamp, reason, resolved, resolved_by, resolve_reason, expired)