Openbravo Issue Tracking System - Modules  | 
| View Issue Details | 
  | 
| ID | Project | Category | View Status | Date Submitted | Last Update | 
| 0038117 | Modules | Warehouse Picking | public | 2018-03-13 13:31 | 2018-05-09 19:29 | 
  | 
| Reporter | JONHM |   | 
| Assigned To | AtulOpenbravo |   | 
| Priority | high | Severity | major | Reproducibility | always | 
| Status | closed | Resolution | fixed |   | 
| Platform |  | OS | 5 | OS Version |  | 
| Product Version |  |   | 
| Target Version |  | Fixed in Version |  |   | 
| Merge Request Status |  | 
| Regression date |  | 
| Regression introduced by commit |  | 
| Regression level |  | 
| Review Assigned To | dmiguelez | 
| Support ticket | 472 | 
| OBNetwork customer | OBPS | 
| Regression introduced in release |  | 
  | 
| Summary | 0038117: Performance problem in Warehouse Picking List when processing a picking with >100 lines | 
| Description | Performance problem in Warehouse Picking List when processing a picking with >100 lines | 
| Steps To Reproduce | Ask environment to support 
 
- Open "Warehouse Picking List" window 
- Select some picking in status 'draft' and which have >100 lines: 
 - PL1023443  
 - PL1023444  
 - PL1023445  
 - PL1023446  
 - PL1023447  
 - PL1023448 
 
- Press 'Process' button 
 
It takes 66864.939 ms to finish | 
| Proposed Solution | Seems to be related with A_ASSET_CREATE function inside the loop of M_Inout_POST function. It takes about 1 minute to finish: 
2018-03-13 12:21:16 enter loop 
2018-03-13 12:22:11 exit loop | 
| Additional Information |  | 
| Tags | No tags attached. | 
| Relationships | | related to  | defect  | 0038121 |   | closed  | Triage Omni WMS  | Performance problem in Warehouse Picking List when cancelling a picking with >100 lines  |  
  | 
| Attached Files |   M_Inout_Post.log (136,064) 2018-03-20 17:03 https://issues.openbravo.com/file_download.php?file_id=11662&type=bug | 
  | 
| Issue History | 
| Date Modified | Username | Field | Change | 
| 2018-03-13 13:31 | JONHM | New Issue |  | 
| 2018-03-13 13:31 | JONHM | Assigned To |  => Triage Finance | 
| 2018-03-13 13:31 | JONHM | Regression date |  => 2018-04-03 | 
| 2018-03-13 13:31 | JONHM | Support ticket |  => 472 | 
| 2018-03-13 13:31 | JONHM | OBNetwork customer |  => Yes | 
| 2018-03-13 14:57 | JONHM | Reproducibility | have not tried => always | 
| 2018-03-13 17:06 | aferraz | Regression date | 2018-04-03 =>  | 
| 2018-03-13 17:06 | aferraz | Resolution time |  => 1522706400 | 
| 2018-03-13 17:13 | JONHM | Relationship added | related to 0038121 | 
| 2018-03-13 22:43 | jfrances | Issue Monitored: jfrances |  | 
| 2018-03-15 13:03 | vmromanos | Note Added: 0103278 |  | 
| 2018-03-15 13:03 | vmromanos | Status | new => feedback | 
| 2018-03-16 12:47 | aferraz | Note Added: 0103315 |  | 
| 2018-03-16 12:48 | aferraz | Assigned To | Triage Finance => JONHM | 
| 2018-03-20 17:01 | JONHM | Note Added: 0103374 |  | 
| 2018-03-20 17:02 | JONHM | Assigned To | JONHM => aferraz | 
| 2018-03-20 17:02 | JONHM | Status | feedback => new | 
| 2018-03-20 17:03 | JONHM | File Added: M_Inout_Post.log |  | 
| 2018-03-20 17:13 | JONHM | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=16894#r16894 | 
| 2018-03-20 17:16 | aferraz | Assigned To | aferraz => AtulOpenbravo | 
| 2018-03-26 19:17 | AtulOpenbravo | Status | new => scheduled | 
| 2018-03-27 10:04 | vmromanos | Note Added: 0103555 |  | 
| 2018-04-04 19:52 | AtulOpenbravo | Note Added: 0103679 |  | 
| 2018-04-04 19:54 | AtulOpenbravo | Note Edited: 0103679 | bug_revision_view_page.php?bugnote_id=0103679#r16952 | 
| 2018-04-04 19:54 | AtulOpenbravo | Note Edited: 0103679 | bug_revision_view_page.php?bugnote_id=0103679#r16953 | 
| 2018-04-04 19:58 | AtulOpenbravo | Note Edited: 0103679 | bug_revision_view_page.php?bugnote_id=0103679#r16954 | 
| 2018-04-05 17:13 | hgbot | Checkin |  | 
| 2018-04-05 17:13 | hgbot | Note Added: 0103696 |  | 
| 2018-04-05 17:13 | hgbot | Status | scheduled => resolved | 
| 2018-04-05 17:13 | hgbot | Resolution | open => fixed | 
| 2018-04-05 17:13 | hgbot | Fixed in SCM revision |  => http://code.openbravo.com/erp/devel/pi/rev/d35a17b838747532cf07e0470b6526bea0ec630c [^] | 
| 2018-04-05 17:13 | dmiguelez | Review Assigned To |  => dmiguelez | 
| 2018-04-05 17:13 | dmiguelez | Note Added: 0103697 |  | 
| 2018-04-05 17:13 | dmiguelez | Status | resolved => closed | 
| 2018-05-09 19:29 | hudsonbot | Checkin |  | 
| 2018-05-09 19:29 | hudsonbot | Note Added: 0104365 |  | 
	| 
		Notes	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
		
			
				Hi Support,  
 
Can you please answer the following 2 questions? 
 
Which Openbravo Core version is running? 
How many organizations does the system have? 
			 | 
		 
		 
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
	 | 
	
		 
	 | 
	
		
		
			| 
				(0103374)
			 | 
		 
		
			| 
				JONHM   
			 | 
		 
		
			| 
				2018-03-20 17:01   
							 | 
		 
		 
	 | 
	
		
		
			
				The commit was applied and there is still a performance problem when processing the picking. Attached is a postgresql log set at NOTICE, see that every iteration on the loop takes about 4 seconds to finish. 
Probably the problem would be on the A_Asset_Create function or the loop on which that function is included on M_Inout_Post function.			 | 
		 
		 
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
		
			
				Hi Support,  
 
Does this instance have a custom extension point on M_INOUT_POST?			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0103679)
			 | 
		 
		
			| 
				AtulOpenbravo   
			 | 
		 
		
			
				2018-04-04 19:52   
				 (edited on: 2018-04-04 19:58)			 | 
		 
		 
	 | 
	
		
		
			
				In client environment, 
 
1. Activate option in postgresql.conf: track_functions = all. Reload postgresql. 
2. Run select pg_stat_reset(); in pgadmin to reset statistics. 
3. Run Process Warehouse Picking List Single Record at once. 
4. Run select * from pg_stat_user_functions; to get number of calls and the total_time and self_time. 
5. Run select pg_stat_reset(); in pgadmin to reset statistics. 
6. Run Process Warehouse Picking List Five Record at once. 
7. Run select * from pg_stat_user_functions; to get number of calls and the total_time and self_time. 
 
Before Change 
 
Function/Trigger : m_transaction_trg2() 
 
Process single warehouse picking list having 200 lines. 
 
No of calls      : 200 
Total Time       : 142684.894 
Self Time        : 142677.622 
 
Process 5 warehouse picking list having 200 lines each. 
 
No of calls      : 1000 
Total Time       : 3137734.768 
Self Time        : 3137698.425 
 
Proposed Change:- In m_transaction_trg2, fetching of pending reservedqty against released qty from m_reservation, m_reservation_stock and qtyonhand from m_storage_detail is done in the same query by joining high volume tables in client environment hence performance of query is poor. To improve the performance split the query into two to get same results. 
 
After Change:- 
 
Function/Trigger : m_transaction_trg2() 
 
Process single warehouse picking list having 200 lines. 
 
No of calls      : 200 
Total Time       : 5690.695  
Self Time        : 5683.838 
 
Process 5 warehouse picking list having 200 lines each. 
 
No of calls      : 1000 
Total Time       : 18482.246 
Self Time        : 18448.121 
 
			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0103696)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2018-04-05 17:13   
							 | 
		 
		 
	 | 
	
		
		
			
				Repository: erp/devel/pi 
Changeset: d35a17b838747532cf07e0470b6526bea0ec630c 
Author: Atul Gaware <atul.gaware <at> openbravo.com> 
Date: Wed Apr 04 22:56:13 2018 +0530 
URL: http://code.openbravo.com/erp/devel/pi/rev/d35a17b838747532cf07e0470b6526bea0ec630c [^] 
 
Fixes Issue 38117: Performance problem in Warehouse Picking List when 
processing a picking with >100 lines 
 
In m_transaction_trg2, split query into two. 
A. Fetch pending reserved qty against released quantity 
from m_reservation and m_reservation_stock 
B. Fetch qtyonhand from m_storage_detail 
In high volume environment, separate query improves 
performance significantly. 
 
--- 
M src-db/database/model/triggers/M_TRANSACTION_TRG2.xml 
--- 
			 | 
		 
		 
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
		
			| 
				Solved in Core for PR18Q3			 | 
		 
		 
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
	 |