Author: nunofsantos
Date: 2008-12-08 13:15:49 -0500 (Mon, 08 Dec 2008)
New Revision: 2949
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/python/mint/schemaparser.py
mgmt/trunk/mint/sql/triggers.sql
Log:
create indexes for qmf_update_time on _stats tables
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-12-08 17:14:23 UTC (rev 2948)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-12-08 18:15:49 UTC (rev 2949)
@@ -1351,16 +1351,16 @@
Master.sqlmeta.addJoin(SQLMultipleJoin('MasterStats',
joinMethodName='stats'))
-classToSchemaNameMap['Acl'] = 'Acl'
-schemaNameToClassMap['Acl'] = Acl
+classToSchemaNameMap['Acl'] = 'acl'
+schemaNameToClassMap['acl'] = Acl
Broker.sqlmeta.addJoin(SQLMultipleJoin('Acl', joinMethodName='acls'))
Acl.sqlmeta.addJoin(SQLMultipleJoin('AclStats', joinMethodName='stats'))
-classToSchemaNameMap['Cluster'] = 'Cluster'
-schemaNameToClassMap['Cluster'] = Cluster
+classToSchemaNameMap['Cluster'] = 'cluster'
+schemaNameToClassMap['cluster'] = Cluster
Broker.sqlmeta.addJoin(SQLMultipleJoin('Cluster',
joinMethodName='clusters'))
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-12-08 17:14:23 UTC (rev 2948)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-12-08 18:15:49 UTC (rev 2949)
@@ -135,9 +135,10 @@
pythonName = self.style.dbTableToPythonClass(schemaName + "_stats")
colPythonName = self.style.dbColumnToPythonAttr(schemaName)
keyPythonName = self.style.dbTableToPythonClass(schemaName)
- #self.sqlTriggersOutput += "DROP TRIGGER update_stats ON %s; \n" %
(self.style.pythonClassToDBTable(pythonName))
- self.sqlTriggersOutput += "CREATE TRIGGER update_stats AFTER INSERT ON %s
\n" % (self.style.pythonClassToDBTable(pythonName))
+ sqlTable = self.style.pythonClassToDBTable(pythonName)
+ self.sqlTriggersOutput += "CREATE TRIGGER update_stats AFTER INSERT ON %s
\n" % (sqlTable)
self.sqlTriggersOutput += " FOR EACH ROW EXECUTE PROCEDURE update_stats();
\n\n"
+ self.sqlTriggersOutput += "CREATE INDEX %s_update_time ON %s
(qmf_update_time);\n\n" % (sqlTable, sqlTable)
else:
pythonName = self.style.dbTableToPythonClass(schemaName)
statsPythonName = self.style.dbTableToPythonClass(schemaName + "_stats")
Modified: mgmt/trunk/mint/sql/triggers.sql
===================================================================
--- mgmt/trunk/mint/sql/triggers.sql 2008-12-08 17:14:23 UTC (rev 2948)
+++ mgmt/trunk/mint/sql/triggers.sql 2008-12-08 18:15:49 UTC (rev 2949)
@@ -17,69 +17,115 @@
CREATE TRIGGER update_stats AFTER INSERT ON slot_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX slot_stats_update_time ON slot_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON job_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX job_stats_update_time ON job_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON scheduler_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX scheduler_stats_update_time ON scheduler_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON submitter_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX submitter_stats_update_time ON submitter_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON negotiator_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX negotiator_stats_update_time ON negotiator_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON collector_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX collector_stats_update_time ON collector_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON master_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX master_stats_update_time ON master_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON acl_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX acl_stats_update_time ON acl_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON cluster_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX cluster_stats_update_time ON cluster_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON store_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX store_stats_update_time ON store_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON journal_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX journal_stats_update_time ON journal_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON system_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX system_stats_update_time ON system_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON broker_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX broker_stats_update_time ON broker_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON agent_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX agent_stats_update_time ON agent_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON vhost_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX vhost_stats_update_time ON vhost_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON queue_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX queue_stats_update_time ON queue_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON exchange_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX exchange_stats_update_time ON exchange_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON binding_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX binding_stats_update_time ON binding_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON client_connection_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX client_connection_stats_update_time ON client_connection_stats
(qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON link_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX link_stats_update_time ON link_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON bridge_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX bridge_stats_update_time ON bridge_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON session_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX session_stats_update_time ON session_stats (qmf_update_time);
+
CREATE TRIGGER update_stats AFTER INSERT ON sysimage_stats
FOR EACH ROW EXECUTE PROCEDURE update_stats();
+CREATE INDEX sysimage_stats_update_time ON sysimage_stats (qmf_update_time);
+
Show replies by date