From b4727a5739bbca0947c5d721610f55430b0b8095 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Wed, 1 Nov 2006 16:48:57 +0000 Subject: [PATCH] merging 7.1.3 changes --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/upgrade_7.1.2-7.1.3.pl | 16 +++++++++++++++- lib/WebGUI/Asset/Template.pm | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 04a1df658..54983dc29 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -32,6 +32,7 @@ (Martin Kamerbeek / Procolix) - Fixed a bug in the Poll where using graphs could result in errors. See gotcha.txt for details. (Martin Kamerbeek / Procolix) + - Added some additional indicies for slightly better performance. 7.1.2 - Fixed a bug where logging in/out would cause a blank page display. diff --git a/docs/upgrades/upgrade_7.1.2-7.1.3.pl b/docs/upgrades/upgrade_7.1.2-7.1.3.pl index 2520ff290..a49a77493 100644 --- a/docs/upgrades/upgrade_7.1.2-7.1.3.pl +++ b/docs/upgrades/upgrade_7.1.2-7.1.3.pl @@ -22,10 +22,24 @@ my $session = start(); # this line required insertAutomaticLDAPRegistrationSetting($session); changeGraphConfigColumnType($session); - +addIndicies($session); finish($session); # this line required +#------------------------------------------------- +sub addIndicies { + my $session = shift; + print "\tAdding database table indicies to improve performance.\n" unless ($quiet); + my $db = $session->db; + $db->write("alter table template add index namespace_showInForms (namespace, showInForms)"); + $db->write("alter table groups add index groupName (groupName)"); + $db->write("alter table Product_feature add index assetId (assetId)"); + $db->write("alter table Product_benefit add index assetId (assetId)"); + $db->write("alter table Product_specification add index assetId (assetId)"); + $db->write("alter table DataForm_field add index assetId_tabId (assetId,DataForm_tabId)"); + $db->write("alter table Post add index threadId_rating (threadId, rating)"); +} + #------------------------------------------------- sub insertAutomaticLDAPRegistrationSetting { my $session = shift; diff --git a/lib/WebGUI/Asset/Template.pm b/lib/WebGUI/Asset/Template.pm index b562791e7..8d95c153d 100644 --- a/lib/WebGUI/Asset/Template.pm +++ b/lib/WebGUI/Asset/Template.pm @@ -132,7 +132,7 @@ sub getEditForm { value=>$self->session->form->get("returnUrl") }); if ($self->getValue("namespace") eq "") { - my $namespaces = $self->session->dbSlave->buildHashRef("select distinct(namespace),namespace from template order by namespace"); + my $namespaces = $self->session->dbSlave->buildHashRef("select distinct(namespace) from template order by namespace"); $tabform->getTab("properties")->combo( -name=>"namespace", -options=>$namespaces,