You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mu...@apache.org on 2013/01/27 18:17:20 UTC

[1/15] git commit: Add DB index to Alert.last_sent column to speed up listAlertsCmd.

Add DB index to Alert.last_sent column to speed up listAlertsCmd.

Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/285e8213
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/285e8213
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/285e8213

Branch: refs/heads/events-framework
Commit: 285e8213fed8b0d6a8afc73b686b99a4fcfe5b4a
Parents: 31a5669
Author: Min Chen <mi...@citrix.com>
Authored: Wed Jan 23 12:38:37 2013 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Jan 23 12:38:37 2013 -0800

----------------------------------------------------------------------
 setup/db/create-schema.sql     |    1 +
 setup/db/db/schema-40to410.sql |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/285e8213/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql
index 174f53c..ead98a5 100755
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@ -1332,6 +1332,7 @@ CREATE TABLE `cloud`.`alert` (
   `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.)',
   PRIMARY KEY  (`id`),
+  INDEX `last_sent` (`last_sent` DESC),
   CONSTRAINT `uc_alert__uuid` UNIQUE (`uuid`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/285e8213/setup/db/db/schema-40to410.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql
index 93949b8..ed4946e 100644
--- a/setup/db/db/schema-40to410.sql
+++ b/setup/db/db/schema-40to410.sql
@@ -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 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
 UPDATE `cloud`.`account` set uuid=id WHERE uuid is NULL;
 UPDATE `cloud`.`alert` set uuid=id WHERE uuid is NULL;