incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pran...@apache.org
Subject git commit: CS-16052 Introducing data-base indexes for autoscale db schema
Date Thu, 23 Aug 2012 12:20:55 GMT
Updated Branches:
  refs/heads/autoscale 5f9656ce8 -> e2a656438


CS-16052 Introducing data-base indexes for autoscale db schema


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

Branch: refs/heads/autoscale
Commit: e2a6564383a249f1069fe2e94e93570f7ca14ba4
Parents: 5f9656c
Author: Deepak Garg <deepakgarg.iitg@gmail.com>
Authored: Thu Aug 23 17:49:55 2012 +0530
Committer: Pranav Saxena <pranav.saxena@citrix.com>
Committed: Thu Aug 23 17:49:55 2012 +0530

----------------------------------------------------------------------
 setup/db/create-schema.sql |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e2a65643/setup/db/create-schema.sql
----------------------------------------------------------------------
diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql
index 8129a6c..2b0b01a 100755
--- a/setup/db/create-schema.sql
+++ b/setup/db/create-schema.sql
@@ -2189,7 +2189,9 @@ CREATE TABLE `cloud`.`counter` (
   `removed` datetime COMMENT 'date removed if not null',
   `created` datetime NOT NULL COMMENT 'date created',
   PRIMARY KEY (`id`),
-  CONSTRAINT `uc_counter__uuid` UNIQUE (`uuid`)
+  CONSTRAINT `uc_counter__uuid` UNIQUE (`uuid`),
+  INDEX `i_counter__removed`(`removed`),
+  INDEX `i_counter__source`(`source`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`conditions` (
@@ -2206,7 +2208,8 @@ CREATE TABLE `cloud`.`conditions` (
   CONSTRAINT `fk_conditions__counter_id` FOREIGN KEY `fk_condition__counter_id`(`counter_id`)
REFERENCES `counter`(`id`),
   CONSTRAINT `fk_conditions__account_id` FOREIGN KEY `fk_condition__account_id` (`account_id`)
REFERENCES `account`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_conditions__domain_id` FOREIGN KEY `fk_condition__domain_id` (`domain_id`)
REFERENCES `domain`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `uc_conditions__uuid` UNIQUE (`uuid`)
+  CONSTRAINT `uc_conditions__uuid` UNIQUE (`uuid`),
+  INDEX `i_conditions__removed`(`removed`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`autoscale_vmprofiles` (
@@ -2228,7 +2231,8 @@ CREATE TABLE `cloud`.`autoscale_vmprofiles` (
   CONSTRAINT `fk_autoscale_vmprofiles__domain_id` FOREIGN KEY `fk_autoscale_vmprofiles__domain_id`
(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_autoscale_vmprofiles__account_id` FOREIGN KEY `fk_autoscale_vmprofiles__account_id`
(`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_autoscale_vmprofiles__autoscale_user_id` FOREIGN KEY `fk_autoscale_vmprofiles__autoscale_user_id`
(`autoscale_user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `uc_autoscale_vmprofiles__uuid` UNIQUE (`uuid`)
+  CONSTRAINT `uc_autoscale_vmprofiles__uuid` UNIQUE (`uuid`),
+  INDEX `i_autoscale_vmprofiles__removed`(`removed`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`autoscale_policies` (
@@ -2244,7 +2248,8 @@ CREATE TABLE `cloud`.`autoscale_policies` (
   PRIMARY KEY  (`id`),
   CONSTRAINT `fk_autoscale_policies__domain_id` FOREIGN KEY `fk_autoscale_policies__domain_id`
(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_autoscale_policies__account_id` FOREIGN KEY `fk_autoscale_policies__account_id`
(`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
-  CONSTRAINT `uc_autoscale_policies__uuid` UNIQUE (`uuid`)
+  CONSTRAINT `uc_autoscale_policies__uuid` UNIQUE (`uuid`),
+  INDEX `i_autoscale_policies__removed`(`removed`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`autoscale_vmgroups` (
@@ -2268,7 +2273,9 @@ CREATE TABLE `cloud`.`autoscale_vmgroups` (
   CONSTRAINT `fk_autoscale_vmgroups__domain_id` FOREIGN KEY `fk_autoscale_vmgroups__domain_id`
(`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_autoscale_vmgroups__account_id` FOREIGN KEY `fk_autoscale_vmgroups__account_id`
(`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE,
   CONSTRAINT `fk_autoscale_vmgroups__zone_id` FOREIGN KEY `fk_autoscale_vmgroups__zone_id`(`zone_id`)
REFERENCES `data_center`(`id`),
-  CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`)
+  CONSTRAINT `uc_autoscale_vmgroups__uuid` UNIQUE (`uuid`),
+  INDEX `i_autoscale_vmgroups__removed`(`removed`),
+  INDEX `i_autoscale_vmgroups__load_balancer_id`(`load_balancer_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`autoscale_policy_condition_map` (
@@ -2277,7 +2284,8 @@ CREATE TABLE `cloud`.`autoscale_policy_condition_map` (
   `condition_id` bigint unsigned NOT NULL,
   PRIMARY KEY  (`id`),
   CONSTRAINT `fk_autoscale_policy_condition_map__policy_id` FOREIGN KEY `fk_autoscale_policy_condition_map__policy_id`
(`policy_id`) REFERENCES `autoscale_policies` (`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_policy_condition_map__condition_id` FOREIGN KEY `fk_autoscale_policy_condition_map__condition_id`
(`condition_id`) REFERENCES `conditions` (`id`)
+  CONSTRAINT `fk_autoscale_policy_condition_map__condition_id` FOREIGN KEY `fk_autoscale_policy_condition_map__condition_id`
(`condition_id`) REFERENCES `conditions` (`id`),
+  INDEX `i_autoscale_policy_condition_map__policy_id`(`policy_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` (
@@ -2286,7 +2294,8 @@ CREATE TABLE `cloud`.`autoscale_vmgroup_policy_map` (
   `policy_id` bigint unsigned NOT NULL,
   PRIMARY KEY  (`id`),
   CONSTRAINT `fk_autoscale_vmgroup_policy_map__vmgroup_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__vmgroup_id`
(`vmgroup_id`) REFERENCES `autoscale_vmgroups` (`id`) ON DELETE CASCADE,
-  CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id`
(`policy_id`) REFERENCES `autoscale_policies` (`id`)
+  CONSTRAINT `fk_autoscale_vmgroup_policy_map__policy_id` FOREIGN KEY `fk_autoscale_vmgroup_policy_map__policy_id`
(`policy_id`) REFERENCES `autoscale_policies` (`id`),
+  INDEX `i_autoscale_vmgroup_policy_map__vmgroup_id`(`vmgroup_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 INSERT INTO `cloud`.`counter` (id, source, name, value,created) VALUES (1,'snmp','Linux User
CPU Time(%)', '.1.3.6.1.4.1.2021.11.9.0', now());


Mime
View raw message