summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--create/mysql/schema.sql3
-rw-r--r--create/postgresql/schema.sql3
-rw-r--r--upgrades/dbpatches/1.0alpha7_to_1.0alpha8/mysql/patch.sql1
-rw-r--r--upgrades/dbpatches/1.0alpha7_to_1.0alpha8/postgresql/patch.sql1
5 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 414b6d47..179eff7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
Changes for 1.0alpha8:
+ - added index (triggerid,clock) for table alarms
- status of triggers will not be shown for disabled and not-supported parameters
-
- fixed availability report
- optimization of chart.html
- added trend.html
diff --git a/create/mysql/schema.sql b/create/mysql/schema.sql
index 57ed174f..72178f15 100644
--- a/create/mysql/schema.sql
+++ b/create/mysql/schema.sql
@@ -140,7 +140,8 @@ CREATE TABLE alarms (
triggerid int(4) DEFAULT '0' NOT NULL,
clock int(4) DEFAULT '0' NOT NULL,
istrue int(4) DEFAULT '0' NOT NULL,
- PRIMARY KEY (alarmid)
+ PRIMARY KEY (alarmid),
+ KEY (triggerid,clock)
);
#
diff --git a/create/postgresql/schema.sql b/create/postgresql/schema.sql
index 5ca0d532..46b81e89 100644
--- a/create/postgresql/schema.sql
+++ b/create/postgresql/schema.sql
@@ -158,7 +158,8 @@ CREATE TABLE alarms (
clock int4 DEFAULT '0' NOT NULL,
istrue int4 DEFAULT '0' NOT NULL,
PRIMARY KEY (alarmid),
- FOREIGN KEY (triggerid) REFERENCES triggers
+ FOREIGN KEY (triggerid) REFERENCES triggers,
+ KEY (triggerid, clock)
);
--
diff --git a/upgrades/dbpatches/1.0alpha7_to_1.0alpha8/mysql/patch.sql b/upgrades/dbpatches/1.0alpha7_to_1.0alpha8/mysql/patch.sql
index 729f2d05..c1a2413c 100644
--- a/upgrades/dbpatches/1.0alpha7_to_1.0alpha8/mysql/patch.sql
+++ b/upgrades/dbpatches/1.0alpha7_to_1.0alpha8/mysql/patch.sql
@@ -1,2 +1,3 @@
alter table graphs_items add color varchar(32) DEFAULT 'Dark Green' NOT NULL;
alter table sysmaps_hosts add icon varchar(32) DEFAULT 'Server' NOT NULL;
+alter table alarms add key (triggerid,clock);
diff --git a/upgrades/dbpatches/1.0alpha7_to_1.0alpha8/postgresql/patch.sql b/upgrades/dbpatches/1.0alpha7_to_1.0alpha8/postgresql/patch.sql
index 729f2d05..db47d6ec 100644
--- a/upgrades/dbpatches/1.0alpha7_to_1.0alpha8/postgresql/patch.sql
+++ b/upgrades/dbpatches/1.0alpha7_to_1.0alpha8/postgresql/patch.sql
@@ -1,2 +1,3 @@
alter table graphs_items add color varchar(32) DEFAULT 'Dark Green' NOT NULL;
alter table sysmaps_hosts add icon varchar(32) DEFAULT 'Server' NOT NULL;
+create index alarms_trggerid_clock on alarms (triggerid,clock);