← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14763: Added some indexes to resource tables

 

------------------------------------------------------------
revno: 14763
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-04-09 20:10:48 +0200
message:
  Added some indexes to resource tables
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java	2014-04-06 13:41:19 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java	2014-04-09 18:10:48 +0000
@@ -131,6 +131,10 @@
         log.info( "Create organisation unit structure table SQL: " + sql );
         
         jdbcTemplate.execute( sql.toString() );
+        
+        final String uidInSql = "create unique index in_orgunitstructure_organisationunituid on _orgunitstructure(organisationunituid)";
+        
+        jdbcTemplate.execute( uidInSql );
     }
     
     // -------------------------------------------------------------------------
@@ -284,6 +288,16 @@
         log.info( "Create data element structure SQL: " + sql );
         
         jdbcTemplate.execute( sql );        
+
+        final String deUdInSql = "create unique index in_dataelementstructure_dataelementuid on _dataelementstructure(dataelementuid)";
+        final String dsIdInSql = "create index in_dataelementstructure_datasetid on _dataelementstructure(datasetid)";
+        final String dsUdInSql = "create index in_dataelementstructure_datasetuid on _dataelementstructure(datasetuid)";
+        final String ptIdInSql = "create index in_dataelementstructure_periodtypeid on _dataelementstructure(periodtypeid)";
+        
+        jdbcTemplate.execute( deUdInSql );
+        jdbcTemplate.execute( dsIdInSql );
+        jdbcTemplate.execute( dsUdInSql );
+        jdbcTemplate.execute( ptIdInSql );
     }
     
     // -------------------------------------------------------------------------
@@ -342,6 +356,10 @@
         log.info( "Create period structure SQL: " + sql );
         
         jdbcTemplate.execute( sql );
+
+        final String isoInSql = "create unique index in_periodstructure_iso on _periodstructure(iso)";
+        
+        jdbcTemplate.execute( isoInSql );
     }
 
     // -------------------------------------------------------------------------