mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add DB index to Alert.last_sent column to speed up listAlertsCmd.
This commit is contained in:
parent
31a5669c7c
commit
285e8213fe
@ -1332,6 +1332,7 @@ CREATE TABLE `cloud`.`alert` (
|
|||||||
`last_sent` DATETIME NULL COMMENT 'Last time the alert was sent',
|
`last_sent` DATETIME NULL COMMENT 'Last time the alert was sent',
|
||||||
`resolved` DATETIME NULL COMMENT 'when the alert status was resolved (available memory no longer at critical level, etc.)',
|
`resolved` DATETIME NULL COMMENT 'when the alert status was resolved (available memory no longer at critical level, etc.)',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
|
INDEX `last_sent` (`last_sent` DESC),
|
||||||
CONSTRAINT `uc_alert__uuid` UNIQUE (`uuid`)
|
CONSTRAINT `uc_alert__uuid` UNIQUE (`uuid`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|||||||
@ -77,6 +77,8 @@ ALTER TABLE `cloud`.`inline_load_balancer_nic_map` DROP COLUMN load_balancer_id;
|
|||||||
ALTER TABLE upload ADD uuid VARCHAR(40);
|
ALTER TABLE upload ADD uuid VARCHAR(40);
|
||||||
ALTER TABLE async_job modify job_cmd VARCHAR(255);
|
ALTER TABLE async_job modify job_cmd VARCHAR(255);
|
||||||
|
|
||||||
|
ALTER TABLE `cloud`.`alert` ADD INDEX `last_sent` (`last_sent` DESC) ;
|
||||||
|
|
||||||
-- populate uuid column with db id if uuid is null
|
-- populate uuid column with db id if uuid is null
|
||||||
UPDATE `cloud`.`account` set uuid=id WHERE uuid is NULL;
|
UPDATE `cloud`.`account` set uuid=id WHERE uuid is NULL;
|
||||||
UPDATE `cloud`.`alert` set uuid=id WHERE uuid is NULL;
|
UPDATE `cloud`.`alert` set uuid=id WHERE uuid is NULL;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user