Add index on UpdatedOn column of Monitor_Status table
parent
13999ab2a3
commit
23bb062ba2
|
|
@ -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;
|
||||
Loading…
Reference in New Issue