summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJoey Hagedorn <hagedorn@mcs.anl.gov>2007-05-31 19:46:59 +0000
committerJoey Hagedorn <hagedorn@mcs.anl.gov>2007-05-31 19:46:59 +0000
commit53c81597cb7f786cb434e2e78deb97d67d1f6731 (patch)
tree4a13bb326fc592e71314beecc800a720ff2c6701 /src/lib
parent920363a9eb77d942eb66775aac8f59cd538871de (diff)
downloadbcfg2-53c81597cb7f786cb434e2e78deb97d67d1f6731.tar.gz
bcfg2-53c81597cb7f786cb434e2e78deb97d67d1f6731.tar.bz2
bcfg2-53c81597cb7f786cb434e2e78deb97d67d1f6731.zip
Reporting system: Fixed significant performance problem with summary and timings views.
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3212 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Reports/reports/sql/client.sql10
-rw-r--r--src/lib/Server/Reports/reports/templatetags/django_templating_sigh.py3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/Server/Reports/reports/sql/client.sql b/src/lib/Server/Reports/reports/sql/client.sql
index 6ef37a27f..8c63754c9 100644
--- a/src/lib/Server/Reports/reports/sql/client.sql
+++ b/src/lib/Server/Reports/reports/sql/client.sql
@@ -1 +1,9 @@
-CREATE VIEW reports_current_interactions AS SELECT x.client_id AS client_id, reports_interaction.id AS interaction_id FROM (select client_id, MAX(timestamp) as timer FROM reports_interaction GROUP BY client_id) x, reports_interaction WHERE reports_interaction.client_id = x.client_id AND reports_interaction.timestamp = x.timer \ No newline at end of file
+CREATE VIEW reports_current_interactions AS SELECT x.client_id AS client_id, reports_interaction.id AS interaction_id FROM (select client_id, MAX(timestamp) as timer FROM reports_interaction GROUP BY client_id) x, reports_interaction WHERE reports_interaction.client_id = x.client_id AND reports_interaction.timestamp = x.timer;
+
+create index reports_interaction_client_id on reports_interaction (client_id);
+create index reports_extra_interactions_client_id on reports_extra_interactions(interaction_id);
+create index reports_modified_interactions_client_id on reports_modified_interactions(interaction_id);
+create index reports_client_current_interaction_id on reports_client (current_interaction_id);
+create index reports_performance_interaction_performance_id on reports_performance_interaction (performance_id);
+create index reports_interaction_timestamp on reports_interaction (timestamp);
+create index reports_performance_interation_interaction_id on reports_performance_interaction (interaction_id); \ No newline at end of file
diff --git a/src/lib/Server/Reports/reports/templatetags/django_templating_sigh.py b/src/lib/Server/Reports/reports/templatetags/django_templating_sigh.py
index 9ccad0496..5591e065e 100644
--- a/src/lib/Server/Reports/reports/templatetags/django_templating_sigh.py
+++ b/src/lib/Server/Reports/reports/templatetags/django_templating_sigh.py
@@ -14,7 +14,8 @@ def set_interaction(parser, token):
return SetInteraction(format_string[1:-1])
def sortwell(value):
- "sorts a list(or evaluates queryset to list) of bad, extra, or modified items in the best way for presentation"
+ "sorts a list(or evaluates queryset to list) of bad, extra, or modified items in the best"
+ "way for presentation"
configItems = list(value)
configItems.sort(lambda x,y: cmp(x.name, y.name))
configItems.sort(lambda x,y: cmp(x.kind, y.kind))