From 23bb062ba2e59198cdaed7b533a8c13f9af2d1bc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 16 Dec 2025 11:15:40 -0500 Subject: [PATCH] Add index on UpdatedOn column of Monitor_Status table --- db/zm_update-1.37.75.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 db/zm_update-1.37.75.sql diff --git a/db/zm_update-1.37.75.sql b/db/zm_update-1.37.75.sql new file mode 100644 index 000000000..5e92c1314 --- /dev/null +++ b/db/zm_update-1.37.75.sql @@ -0,0 +1,15 @@ + + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.STATISTICS + WHERE table_name = 'Monitor_Status' + AND table_schema = DATABASE() + AND index_name = 'Monitor_Status_UpdatedOn_idx' + ) > 0, +"SELECT 'UpdateOn Index already exists on Monitor_Status table'", +"CREATE INDEX Monitor_Status_UpdatedOn_idx on Monitor_Status(UpdatedOn)" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt;