← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8370: Doing explicit vacuum and analyze of data mart tables after copy from temp tables, if on postgres

 

------------------------------------------------------------
revno: 8370
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-03 20:14:28 +0200
message:
  Doing explicit vacuum and analyze of data mart tables after copy from temp tables, if on postgres
modified:
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/JdbcDataMartManager.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-datamart-default/src/main/java/org/hisp/dhis/datamart/JdbcDataMartManager.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/JdbcDataMartManager.java	2012-10-01 11:28:38 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/JdbcDataMartManager.java	2012-10-03 18:14:28 +0000
@@ -330,28 +330,39 @@
     public void copyAggregatedDataValuesFromTemp()
     {
         executeSilently( "insert into aggregateddatavalue select * from aggregateddatavalue_temp" );
+        
+        executeSilently( statementBuilder.getVacuum( "aggregateddatavalue" ) );
     }
 
     public void copyAggregatedIndicatorValuesFromTemp()
     {
         executeSilently( "insert into aggregatedindicatorvalue select * from aggregatedindicatorvalue_temp" );
+        
+        executeSilently( statementBuilder.getVacuum( "aggregatedindicatorvalue" ) );
     }
 
     public void copyAggregatedOrgUnitDataValuesFromTemp()
     {
         executeSilently( "insert into aggregatedorgunitdatavalue select * from aggregatedorgunitdatavalue_temp" );
+        
+        executeSilently( statementBuilder.getVacuum( "aggregatedorgunitdatavalue" ) );
     }
 
     public void copyAggregatedOrgUnitIndicatorValuesFromTemp()
     {
         executeSilently( "insert into aggregatedorgunitindicatorvalue select * from aggregatedorgunitindicatorvalue_temp" );
+        
+        executeSilently( statementBuilder.getVacuum( "aggregatedorgunitindicatorvalue" ) );
     }
 
     private void executeSilently( String sql )
     {
         try
         {
-            statementManager.getHolder().executeUpdate( sql, true );
+            if ( sql != null )
+            {
+                statementManager.getHolder().executeUpdate( sql, true );
+            }
         }
         catch ( Exception ex )
         {