From 1e93d141525faecead891d04193ada18cad1340b Mon Sep 17 00:00:00 2001 From: St0ny <42348051+Raz0r1337@users.noreply.github.com> Date: Sun, 27 Apr 2025 23:07:22 +0200 Subject: [PATCH] Add index on playerbots_random_bots to reduce deadlocks (#1247) This commit adds a missing composite index on the `playerbots_random_bots` table (`owner`, `bot`, `event`) to improve database performance during high playerbot activity. Adding this index significantly reduces the occurrence of deadlocks when multiple threads access the random bots table simultaneously. The change is 100% backward-compatible and does not affect existing data or functionality. --- data/sql/playerbots/updates/db_playerbots/2025_04_26.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 data/sql/playerbots/updates/db_playerbots/2025_04_26.sql diff --git a/data/sql/playerbots/updates/db_playerbots/2025_04_26.sql b/data/sql/playerbots/updates/db_playerbots/2025_04_26.sql new file mode 100644 index 00000000..d7f25ecd --- /dev/null +++ b/data/sql/playerbots/updates/db_playerbots/2025_04_26.sql @@ -0,0 +1,9 @@ +-- ########################################################## +-- # Playerbots RandomBots Performance Update +-- # Add missing index to reduce Deadlocks +-- # Author: Raz0r1337 aka St0ny +-- # Date: 2025-04-26 +-- ########################################################## + +ALTER TABLE `playerbots_random_bots` +ADD INDEX `idx_owner_bot_event` (`owner`, `bot`, `event`); \ No newline at end of file