bug 9519 : add index to avoid table locking

This commit is contained in:
Kelven Yang 2011-04-28 18:41:01 -07:00
parent 3ea4b18311
commit ed76394b8e
2 changed files with 3 additions and 0 deletions

View File

@ -112,3 +112,5 @@ ALTER TABLE `cloud`.`instance_group_vm_map` ADD CONSTRAINT `fk_instance_group_vm
ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__account_id` FOREIGN KEY `fk_ssh_keypair__account_id` (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE;
ALTER TABLE `cloud`.`ssh_keypairs` ADD CONSTRAINT `fk_ssh_keypairs__domain_id` FOREIGN KEY `fk_ssh_keypair__domain_id` (`domain_id`) REFERENCES `domain` (`id`) ON DELETE CASCADE;
ALTER TABLE `cloud`.`usage_event` ADD INDEX `i_usage_event__created`(`created`);

View File

@ -155,4 +155,5 @@ ALTER TABLE `cloud`.`storage_pool` MODIFY COLUMN `uuid` varchar(255) UNIQUE;
ALTER TABLE `cloud`.`user_statistics` DROP KEY `account_id`;
ALTER TABLE `cloud`.`user_statistics` ADD UNIQUE KEY `account_id` (`account_id`,`data_center_id`, `public_ip_address`, `device_id`,`device_type`);
ALTER TABLE `cloud`.`usage_event` ADD INDEX `i_usage_event__created`(`created`);