Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0028968
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2015-02-17 16:572015-03-13 09:34
ReporteregoitzView Statuspublic 
Assigned Toinigosanchez 
PriorityurgentResolutionfixedFixed in Version3.0PR15Q2
StatusclosedFix in branchFixed in SCM revision3610bd347abc
ProjectionnoneETAnoneTarget Version3.0PR15Q3
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0028968: When installing a module the rebuild takes long to start when clicking on the rebuild button

DescriptionWhen clicking on the rebuild button of the module management window, a poup is opened with 2 options. Rebuild and cancel.

When the ad_session table has more than a million of rows for many different users, after click the rebuild button it takes more than a minute to start the rebuild.

That could cause performance problems if you click on the button more than once if you think that you have not click properly the button.

Steps To Reproduce-ON an environment with more than 1.000.000 rows on the ad_session table for different users install a module.
-Then click on rebuild button and on the popup click on the rebuild button again.
*It takes long to start the rebuild process

Proposed SolutionAttached a proposal solution.
The problem is that before rebuilding all the session for users different that your current users are set as session_active='N'.
It done for all the sessions , also the ones that are already with value 'N'
TagsPerformance
Attached Filesdiff file icon rebuild.diff [^] (780 bytes) 2015-02-17 16:57 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0075443)
hgbot (developer)
2015-03-11 10:44

Repository: erp/devel/pi
Changeset: 3610bd347abc64f737a046903ecf5083c13af938
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Wed Mar 11 10:42:05 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/3610bd347abc64f737a046903ecf5083c13af938 [^]

Fixed issue 28968: When installing a module the rebuild takes long to start.

The problem was that when installing a module the rebuild takes long to start.
This happened on environments with a lot of rows (Tested with 260.000 rows) on
the ad_session table.The result was this:

explain UPDATE AD_SESSION SET SESSION_ACTIVE='N' WHERE CREATEDBY<>'100'
Update on ad_session (cost=0.00..21546.15 rows=266303 width=147)

  -> Seq Scan on ad_session (cost=0.00..21546.15 rows=266303 width=147)
        Filter: ((createdby)::text <> '100'::text)
    Approx time execution: 30000 ms

The new SQL Query to update is this:

explain UPDATE AD_SESSION SET SESSION_ACTIVE='N' WHERE CREATEDBY<>'100' and SESSION_ACTIVE='Y'
Update on ad_session (cost=0.42..4.44 rows=1 width=147)

  -> Index Scan using ad_session_active_idx on ad_session (cost=0.42..4.44 rows=1 width=147)
        Index Cond: (session_active = 'Y'::bpchar)
        Filter: ((createdby)::text <> '100'::text)
    Approx time execution: 30 ms

Adding the new condition "SESSION_ACTIVE = 'Y'" has been achieved to improve the performance.

---
M src/org/openbravo/erpCommon/ad_process/ApplyModules.java
---
(0075497)
hudsonbot (developer)
2015-03-12 17:10

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/4f8a4e2f76d2 [^]
Maturity status: Test
(0075519)
alostale (manager)
2015-03-13 09:34

code reviewed

tested with 300k rows in ad_session: big improvement from ~30s to ~30ms. Note additional benefit: improvement is not only in the execution plan but also preventing tons of unneeded updates session_active='N' -> session_active='N' which cause disk writes.

- Issue History
Date Modified Username Field Change
2015-02-17 16:57 egoitz New Issue
2015-02-17 16:57 egoitz Assigned To => AugustoMauch
2015-02-17 16:57 egoitz File Added: rebuild.diff
2015-02-17 16:57 egoitz Modules => Core
2015-02-17 16:57 egoitz Resolution time => 1426460400
2015-02-17 16:57 egoitz Triggers an Emergency Pack => No
2015-02-17 16:58 egoitz Tag Attached: Performance
2015-02-23 08:48 alostale Target Version 3.0PR14Q3.6 => 3.0PR15Q2
2015-02-23 08:48 alostale Status new => acknowledged
2015-02-23 13:30 jonalegriaesarte Target Version 3.0PR15Q2 => 3.0PR15Q3
2015-03-05 17:49 alostale Status acknowledged => scheduled
2015-03-05 17:49 alostale Assigned To AugustoMauch => inigosanchez
2015-03-11 10:43 inigosanchez Review Assigned To => alostale
2015-03-11 10:43 inigosanchez Resolution open => fixed
2015-03-11 10:44 hgbot Checkin
2015-03-11 10:44 hgbot Note Added: 0075443
2015-03-11 10:44 hgbot Status scheduled => resolved
2015-03-11 10:44 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3610bd347abc64f737a046903ecf5083c13af938 [^]
2015-03-12 17:10 hudsonbot Checkin
2015-03-12 17:10 hudsonbot Note Added: 0075497
2015-03-13 09:34 alostale Note Added: 0075519
2015-03-13 09:34 alostale Status resolved => closed
2015-03-13 09:34 alostale Fixed in Version => 3.0PR15Q2


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker