Add index on UpdatedOn column of Monitor_Status table

pull/4492/head
Isaac Connor 2025-12-16 11:15:40 -05:00
parent 13999ab2a3
commit 23bb062ba2
1 changed files with 15 additions and 0 deletions

15
db/zm_update-1.37.75.sql Normal file
View File

@ -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;