From: <rm...@hy...> - 2008-03-11 02:26:59
|
Author: rmorgan Date: 2008-03-10 19:26:55 -0700 (Mon, 10 Mar 2008) New Revision: 8165 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=8165 Modified: branches/HQ_3_2/installer/data/db-upgrade.xml branches/HQ_3_2/sql/measurement/MetricAuxLogPojo.hbm.xml Log: Create missing index on metric_id causing slow deletes on EAM_MEASUREMENT. [HHQ-1795] [merge from trunk] Modified: branches/HQ_3_2/installer/data/db-upgrade.xml =================================================================== --- branches/HQ_3_2/installer/data/db-upgrade.xml 2008-03-11 01:58:31 UTC (rev 8164) +++ branches/HQ_3_2/installer/data/db-upgrade.xml 2008-03-11 02:26:55 UTC (rev 8165) @@ -7994,6 +7994,15 @@ </schema-directSQL> </schemaSpec> + <!-- Create missing index on metric_id causing slow deletes on EAM_MEASUREMENT --> + <schemaSpec version="3.96.3"> + <schema-directSQL> + <statement desc="Add missing index on foreign key to EAM_MEASUREMENT"> + CREATE INDEX AUX_LOG_METRIC_ID_IDX ON EAM_METRIC_AUX_LOGS(metric_id) + </statement> + </schema-directSQL> + </schemaSpec> + </dbupgrade> </target> Modified: branches/HQ_3_2/sql/measurement/MetricAuxLogPojo.hbm.xml =================================================================== --- branches/HQ_3_2/sql/measurement/MetricAuxLogPojo.hbm.xml 2008-03-11 01:58:31 UTC (rev 8164) +++ branches/HQ_3_2/sql/measurement/MetricAuxLogPojo.hbm.xml 2008-03-11 02:26:55 UTC (rev 8165) @@ -19,7 +19,7 @@ </many-to-one> <many-to-one name="metric"> - <column name="METRIC_ID" not-null="true"/> + <column name="METRIC_ID" index="AUX_LOG_METRIC_ID_IDX" not-null="true"/> </many-to-one> <many-to-one name="alertDef"> |