Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||||||
View Issue Details | |||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||||
0022086 | Openbravo ERP | 07. Sales management | public | 2012-10-24 10:44 | 2013-01-24 13:02 | ||||||||||||
Reporter | egoitz | ||||||||||||||||
Assigned To | ioritzCia | ||||||||||||||||
Priority | urgent | Severity | minor | Reproducibility | always | ||||||||||||
Status | new | Resolution | open | ||||||||||||||
Platform | OS | 5 | OS Version | ||||||||||||||
Product Version | |||||||||||||||||
Target Version | Fixed in Version | ||||||||||||||||
Merge Request Status | |||||||||||||||||
Review Assigned To | |||||||||||||||||
OBNetwork customer | |||||||||||||||||
Web browser | |||||||||||||||||
Modules | Core | ||||||||||||||||
Support ticket | |||||||||||||||||
Regression level | |||||||||||||||||
Regression date | |||||||||||||||||
Regression introduced in release | |||||||||||||||||
Regression introduced by commit | |||||||||||||||||
Triggers an Emergency Pack | No | ||||||||||||||||
Summary | 0022086: M_INOUT_POST are using an OR in a CURSOR so the query is doing a Full Table Scan which has a very big impact in performance | ||||||||||||||||
Description | n the M_INOUT_POST we have this code https://code.openbravo.com/erp/devel/pi/file/3ae1a7bf1d80/src-db/database/model/functions/M_INOUT_POST.xml#l277 [^] FOR Cur_InOut IN (SELECT * FROM M_INOUT WHERE(M_InOut_ID=v_Record_ID OR(v_Record_ID IS NULL AND DocAction='CO')) AND IsActive='Y' FOR UPDATE ) Even when the v_Record_ID is filled, the query with an OR condition on the input variable is causing a full table scan in M_INOUT. Proposal: Doing the same logic in this way: IF v_Record_ID IS NOT NULL THEN OPEN InOutRecCsr FOR SELECT * FROM M_INOUT WHERE M_InOut_ID = v_Record_ID and IsActive = 'Y' FOR UPDATE; ELSE OPEN InOutRecCsr FOR SELECT * FROM M_INOUT WHERE DocAction = 'CO' and IsActive = 'Y' FOR UPDATE; END IF; LOOP FETCH InOutRecCsr INTO Cur_InOut; EXIT WHEN InOutRecCsr%NOTFOUND; Reduce the cost to less than 1%. | ||||||||||||||||
Steps To Reproduce | -Execute a m_inout_post on a database with a big number of lines on m_inout table. *See that takes long to execute the porcess | ||||||||||||||||
Proposed Solution | |||||||||||||||||
Additional Information | |||||||||||||||||
Tags | No tags attached. | ||||||||||||||||
Relationships |
| ||||||||||||||||
Attached Files | |||||||||||||||||
Issue History | |||||||||||||||||
Date Modified | Username | Field | Change | ||||||||||||||
2012-10-24 10:44 | egoitz | New Issue | |||||||||||||||
2012-10-24 10:44 | egoitz | Assigned To | => dmiguelez | ||||||||||||||
2012-10-24 10:44 | egoitz | Modules | => Core | ||||||||||||||
2012-10-24 10:44 | egoitz | Resolution time | => 1352934000 | ||||||||||||||
2012-10-24 10:46 | dmiguelez | Assigned To | dmiguelez => jonalegriaesarte | ||||||||||||||
2012-10-24 10:46 | egoitz | Assigned To | jonalegriaesarte => jecharri | ||||||||||||||
2012-10-24 10:46 | egoitz | Priority | urgent => immediate | ||||||||||||||
2012-10-24 12:49 | jonalegriaesarte | Type | design defect => defect | ||||||||||||||
2012-10-24 12:49 | jonalegriaesarte | Target Version | => 3.0MP17 | ||||||||||||||
2012-10-30 15:43 | hgbot | Checkin | |||||||||||||||
2012-10-30 15:43 | hgbot | Note Added: 0053833 | |||||||||||||||
2012-10-30 15:43 | hgbot | Status | new => resolved | ||||||||||||||
2012-10-30 15:43 | hgbot | Resolution | open => fixed | ||||||||||||||
2012-10-30 15:43 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/aff94b13c45dff7f4dc49040fdff5a329ab1f7cf [^] | ||||||||||||||
2012-10-30 18:06 | jecharri | Note Added: 0053855 | |||||||||||||||
2012-10-31 13:31 | hudsonbot | Checkin | |||||||||||||||
2012-10-31 13:31 | hudsonbot | Note Added: 0053940 | |||||||||||||||
2012-10-31 19:05 | egoitz | Note Added: 0053953 | |||||||||||||||
2012-10-31 19:05 | egoitz | Status | resolved => new | ||||||||||||||
2012-10-31 19:05 | egoitz | Resolution | fixed => open | ||||||||||||||
2012-10-31 19:08 | egoitz | Note Added: 0053954 | |||||||||||||||
2012-10-31 19:32 | jecharri | Target Version | 3.0MP17 => 3.0MP18 | ||||||||||||||
2012-10-31 19:51 | hgbot | Checkin | |||||||||||||||
2012-10-31 19:51 | hgbot | Note Added: 0053960 | |||||||||||||||
2012-11-06 10:47 | hudsonbot | Checkin | |||||||||||||||
2012-11-06 10:47 | hudsonbot | Note Added: 0054027 | |||||||||||||||
2012-12-04 11:49 | jonalegriaesarte | Target Version | 3.0MP18 => 3.0MP19 | ||||||||||||||
2012-12-10 12:49 | jonalegriaesarte | Assigned To | jecharri => ioritzCia | ||||||||||||||
2012-12-10 12:50 | jonalegriaesarte | Triggers an Emergency Pack | => No | ||||||||||||||
2012-12-10 12:50 | jonalegriaesarte | Note Added: 0054800 | |||||||||||||||
2012-12-10 12:50 | jonalegriaesarte | Priority | immediate => urgent | ||||||||||||||
2012-12-10 12:50 | jonalegriaesarte | Severity | major => minor | ||||||||||||||
2013-01-09 11:28 | jonalegriaesarte | Target Version | 3.0MP19 => 3.0MP20 | ||||||||||||||
2013-01-23 16:55 | ioritzCia | Relationship added | depends on 0022875 | ||||||||||||||
2013-01-23 16:57 | ioritzCia | Note Added: 0055774 | |||||||||||||||
2013-01-23 16:57 | ioritzCia | Type | defect => design defect | ||||||||||||||
2013-01-23 23:35 | shuehner | Issue Monitored: shuehner | |||||||||||||||
2013-01-24 11:30 | jonalegriaesarte | Target Version | 3.0MP20 => | ||||||||||||||
2013-01-24 13:01 | jonalegriaesarte | Assigned To | ioritzCia => jecharri | ||||||||||||||
2013-01-24 13:02 | jonalegriaesarte | Assigned To | jecharri => ioritzCia |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|