From 3c842cf7df3d271718a07be69e12ea8cd6438324 Mon Sep 17 00:00:00 2001 From: stan Date: Sun, 9 Dec 2007 13:44:47 +0000 Subject: [PATCH] Bug 417 - Optimised Events indicies git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2252 e3e1d417-86f3-4887-817a-d78f3d33393f --- db/zm_create.sql.in | 3 +-- db/zm_update-1.22.3.sql | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 4dfe2018c..51c67e150 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -204,8 +204,7 @@ CREATE TABLE `Events` ( `Executed` tinyint(3) unsigned NOT NULL default '0', `LearnState` char(1) default '', `Notes` text, - PRIMARY KEY (`Id`), - KEY `Id` (`Id`,`MonitorId`), + PRIMARY KEY (`Id`,`MonitorId`), KEY `MonitorId` (`MonitorId`), KEY `StartTime` (`StartTime`), KEY `Frames` (`Frames`), diff --git a/db/zm_update-1.22.3.sql b/db/zm_update-1.22.3.sql index 5bacc552f..6901d6821 100644 --- a/db/zm_update-1.22.3.sql +++ b/db/zm_update-1.22.3.sql @@ -52,6 +52,9 @@ alter table Frames drop index `UC_Id`; alter table Users drop index `UC_Id`; alter table ZonePresets drop index `UC_Id`; alter table Zones drop index `UC_Id`; +alter table Events drop primary key; +alter table Events add primary key ( `Id`, `MonitorId` ); +alter table Events drop index `Id`; -- -- These are optional, but we might as well do it now