Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025161Openbravo ERPA. Platformpublic2013-11-15 01:292013-12-18 11:44
jonalegriaesarte 
shankarb 
normalmajorhave not tried
closedfixed 
5
 
3.0MP313.0MP31 
AugustoMauch
Core
No
0025161: Alert Management window's link's bad performance
There is an issue with the Alert Management window where the link to a specific record would cause an expensive query to fire. For example, if you had
an alert that referenced a specific sales order and you clicked on the link to navigate to that order, then the following query would be executed twice
and the query does not have any limit:

select order0_.C_Order_ID as col_0_0_
from C_Order order0_, C_DocType documentty1_
where order0_.C_DocTypeTarget_ID=documentty1_.C_DocType_ID
and order0_.IsSOTrx='Y'
and documentty1_.IsReturn='N'
and (documentty1_.DocSubTypeSO not like 'OB')
and (order0_.AD_Org_ID in ('20061' , '20063' , '20062' , '20003' , '20002' , '20023' , '20022' , '20025' , '20001' , '20026' , '20064' , '20065' ,
'20066' , '20067' , '20068' , '20052' , '20051' , '20012' , '20011' , '0' , '20016' , '20015' , '20055' , '20056' , '20053' , '20054'))
and (order0_.AD_Client_ID in ('1969' , '0'))
order by order0_.DocumentNo, order0_.C_Order_ID


The function that is used to open the window is : openDirectTab

So, all the function to open tabs and windows should be checked and fixed in order to improve the performance.
There is an issue with the Alert Management window where the link to a specific record would cause an expensive query to fire. For example, if you had
an alert that referenced a specific sales order and you clicked on the link to navigate to that order, then the following query would be executed twice
and the query does not have any limit:

select order0_.C_Order_ID as col_0_0_
from C_Order order0_, C_DocType documentty1_
where order0_.C_DocTypeTarget_ID=documentty1_.C_DocType_ID
and order0_.IsSOTrx='Y'
and documentty1_.IsReturn='N'
and (documentty1_.DocSubTypeSO not like 'OB')
and (order0_.AD_Org_ID in ('20061' , '20063' , '20062' , '20003' , '20002' , '20023' , '20022' , '20025' , '20001' , '20026' , '20064' , '20065' ,
'20066' , '20067' , '20068' , '20052' , '20051' , '20012' , '20011' , '0' , '20016' , '20015' , '20055' , '20056' , '20053' , '20054'))
and (order0_.AD_Client_ID in ('1969' , '0'))
order by order0_.DocumentNo, order0_.C_Order_ID


The function that is used to open the window is : openDirectTab

So, all the function to open tabs and windows should be checked and fixed in order to improve the performance.
Performance
related to defect 00251593.0MP31 closed shankarb Bad performance executing openView function 
related to defect 0025136 closed shankarb Linked items navigation not working as expected (3d level subtab) 
diff Fix25161-25159-25136.diff (4,046) 2013-11-28 10:14
https://issues.openbravo.com/file_download.php?file_id=6532&type=bug
Issue History
2013-11-15 01:29jonalegriaesarteNew Issue
2013-11-15 01:29jonalegriaesarteAssigned To => AugustoMauch
2013-11-15 01:29jonalegriaesarteModules => Core
2013-11-15 01:29jonalegriaesarteTriggers an Emergency Pack => No
2013-11-15 01:30jonalegriaesarteTag Attached: Performance
2013-11-19 17:44alostaleAssigned ToAugustoMauch => shankarb
2013-11-21 16:19jonalegriaesarteTarget Version3.0MP31 => 3.0MP30
2013-11-22 07:25alostaleRelationship addedrelated to 0025159
2013-11-26 11:53alostaleRelationship addedrelated to 0025136
2013-11-27 06:11shankarbFile Added: Fix25161-25159-25136.diff
2013-11-27 09:57shankarbNote Added: 0062394
2013-11-27 11:32alostaleNote Added: 0062401
2013-11-27 11:32alostaleTarget Version3.0MP30 => 3.0MP31
2013-11-28 10:14shankarbFile Deleted: Fix25161-25159-25136.diff
2013-11-28 10:14shankarbFile Added: Fix25161-25159-25136.diff
2013-12-05 08:03shankarbIssue Monitored: AugustoMauch
2013-12-05 08:07shankarbReview Assigned To => AugustoMauch
2013-12-05 08:11hgbotCheckin
2013-12-05 08:11hgbotNote Added: 0062544
2013-12-05 08:11hgbotStatusnew => resolved
2013-12-05 08:11hgbotResolutionopen => fixed
2013-12-05 08:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0ca986e840a24c89b4b5de3af108ac74f90deabf [^]
2013-12-18 11:44AugustoMauchNote Added: 0062772
2013-12-18 11:44AugustoMauchStatusresolved => closed
2013-12-18 11:44AugustoMauchFixed in Version => 3.0MP31

Notes
(0062394)
shankarb   
2013-11-27 09:57   
Modification done in openDirectTab:

* Added a new parameter direct that would enable only to fetch the particular record alone.
* By default it is set to true if recordId argument is present.
* If all data needs to be fetched, the argument should be passed as false.

Before the fix, even if the recordId was passed, all the records of the grid will be fetched, but the record provided will be shown. After the fix, if the recordId is passed, only that particular record is filtered and fetched.

To revert back to the original scenario, the argument 'direct' has to be set to false. This will again fetch all the records of the grid and select the record passed.
(0062401)
alostale   
2013-11-27 11:32   
Postponed to mp31 due to being in closing period for mp30
(0062544)
hgbot   
2013-12-05 08:11   
Repository: erp/devel/pi
Changeset: 0ca986e840a24c89b4b5de3af108ac74f90deabf
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Thu Nov 28 14:43:09 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/0ca986e840a24c89b4b5de3af108ac74f90deabf [^]

Fixes Issue 25161,25159,25136 : openDirectTab and openView optimization

Modifications in OB.Utilities.openDirectTab
* Added a new parameter direct that would enable only to fetch the particular record alone.
* By default it is set to true if recordId argument is present.
* If all data needs to be fetched, the argument should be passed as false.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
---
(0062772)
AugustoMauch   
2013-12-18 11:44   
Code reviewed and verified in pi@469ba15fbba3