|
From: <gem...@li...> - 2012-08-23 13:37:47
|
Revision: 901
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=901&view=rev
Author: matijsdejong
Date: 2012-08-23 13:37:41 +0000 (Thu, 23 Aug 2012)
Log Message:
-----------
Added some indices for faster database access
Modified Paths:
--------------
trunk/library/classes/GemsEscort.php
trunk/library/configs/db/patches.sql
trunk/library/configs/db/tables/gems__respondent2org.50.sql
trunk/library/configs/db/tables/gems__tokens.200.sql
trunk/library/configs/db/tables/gems__tracks.30.sql
Modified: trunk/library/classes/GemsEscort.php
===================================================================
--- trunk/library/classes/GemsEscort.php 2012-08-22 10:53:51 UTC (rev 900)
+++ trunk/library/classes/GemsEscort.php 2012-08-23 13:37:41 UTC (rev 901)
@@ -520,7 +520,12 @@
return $view;
}
- /*protected function _initZFDebug()
+ /**
+ * Add ZFDebug info to the page output.
+ *
+ * @return void
+ * /
+ protected function _initZFDebug()
{
// if ((APPLICATION_ENV === 'development') &&
if ((APPLICATION_ENV !== 'production') &&
Modified: trunk/library/configs/db/patches.sql
===================================================================
--- trunk/library/configs/db/patches.sql 2012-08-22 10:53:51 UTC (rev 900)
+++ trunk/library/configs/db/patches.sql 2012-08-23 13:37:41 UTC (rev 901)
@@ -419,4 +419,12 @@
ALTER TABLE `gems__surveys` ADD gsu_code varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' NULL AFTER gsu_duration;
-- PATCH: Assign deletion of track parts to super role
-UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.track-maintenance.delete') WHERE grl_privileges NOT LIKE '%pr.track-maintenance.edit%' AND grl_privileges NOT LIKE '%pr.track-maintenance.delete%';
\ No newline at end of file
+UPDATE gems__roles SET grl_privileges = CONCAT(grl_privileges,',pr.track-maintenance.delete') WHERE grl_privileges NOT LIKE '%pr.track-maintenance.edit%' AND grl_privileges NOT LIKE '%pr.track-maintenance.delete%';
+
+-- GEMS VERSION: 49
+-- PATCH: Speed up show respondent
+ALTER TABLE `gems__respondent2org` ADD INDEX ( `gr2o_reception_code` );
+ALTER TABLE `gems__tokens` ADD INDEX ( `gto_round_order` );
+ALTER TABLE `gems__tokens` ADD INDEX ( `gto_valid_from`, `gto_valid_until` );
+ALTER TABLE `gems__tokens` ADD INDEX ( `gto_completion_time` );
+ALTER TABLE `gems__tracks` ADD INDEX ( `gtr_track_name` );
\ No newline at end of file
Modified: trunk/library/configs/db/tables/gems__respondent2org.50.sql
===================================================================
--- trunk/library/configs/db/tables/gems__respondent2org.50.sql 2012-08-22 10:53:51 UTC (rev 900)
+++ trunk/library/configs/db/tables/gems__respondent2org.50.sql 2012-08-23 13:37:41 UTC (rev 901)
@@ -1,23 +1,23 @@
CREATE TABLE if not exists gems__respondent2org (
gr2o_patient_nr varchar(7) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null,
- gr2o_id_organization bigint unsigned not null
+ gr2o_id_organization bigint unsigned not null
references gems__organizations (gor_id_organization),
-
- gr2o_id_user bigint unsigned not null
+
+ gr2o_id_user bigint unsigned not null
references gems__respondents (grs_id_user),
-
+
-- gr2o_id_physician bigint unsigned null
-- references gems_staff (gsf_id_user),
-
+
-- gr2o_treatment varchar(200) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
-- gr2o_comments text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
-
+
gr2o_consent varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'Unknown'
references gems__consents (gco_description),
gr2o_reception_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' default 'OK' not null
references gems__reception_codes (grc_id_reception_code),
-
+
gr2o_opened timestamp not null default current_timestamp on update current_timestamp,
gr2o_opened_by bigint unsigned not null,
gr2o_changed timestamp not null,
@@ -25,9 +25,10 @@
gr2o_created timestamp not null,
gr2o_created_by bigint unsigned not null,
- PRIMARY KEY (gr2o_patient_nr, gr2o_id_organization),
+ PRIMARY KEY (gr2o_patient_nr, gr2o_id_organization),
UNIQUE KEY (gr2o_id_user, gr2o_id_organization),
- INDEX (gr2o_opened)
+ INDEX (gr2o_opened),
+ INDEX (gr2o_reception_code)
)
ENGINE=InnoDB
CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';
Modified: trunk/library/configs/db/tables/gems__tokens.200.sql
===================================================================
--- trunk/library/configs/db/tables/gems__tokens.200.sql 2012-08-22 10:53:51 UTC (rev 900)
+++ trunk/library/configs/db/tables/gems__tokens.200.sql 2012-08-23 13:37:41 UTC (rev 901)
@@ -53,7 +53,9 @@
INDEX (gto_id_track),
INDEX (gto_id_round),
INDEX (gto_in_source),
- INDEX (gto_id_respondent_track, gto_round_order)
+ INDEX (gto_id_respondent_track, gto_round_order),
+ INDEX (gto_valid_from, gto_valid_until),
+ INDEX (gto_completion_time)
)
ENGINE=InnoDB
CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';
Modified: trunk/library/configs/db/tables/gems__tracks.30.sql
===================================================================
--- trunk/library/configs/db/tables/gems__tracks.30.sql 2012-08-22 10:53:51 UTC (rev 900)
+++ trunk/library/configs/db/tables/gems__tracks.30.sql 2012-08-23 13:37:41 UTC (rev 901)
@@ -28,6 +28,7 @@
gtr_created_by bigint unsigned not null,
PRIMARY KEY (gtr_id_track),
+ INDEX (gtr_track_name),
INDEX (gtr_active)
)
ENGINE=InnoDB
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|