Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036804Openbravo ERP02. Master data managementpublic2017-09-07 11:272017-09-07 13:55
JONHM 
Triage Omni OMS 
highmajoralways
closedno change required 
5
 
 
aferraz
Core
No
0036804: Deleting a line on the shipment/receipt line tab takes long on environment with big amount of data
Deleting a line on the shipment/receipt line tab takes long on environment with big amount of data
-On an environment with thousands of order, invoices and shipment create a goods shipement/receipt, then create a line and finally remove the line.

It takes 1.9 seconds

It is already applied the patch from issue 32677 but it do not solve the issue.

Contact JONHM for an environment where that is reproducible
No tags attached.
related to defect 0032677 closed collazoandy4 Deleting a line on the shipment/receipt line tab takes long on environment with big amount of data 
Issue History
2017-09-07 11:27JONHMNew Issue
2017-09-07 11:27JONHMAssigned To => Triage Finance
2017-09-07 11:27JONHMModules => Core
2017-09-07 11:27JONHMResolution time => 1506549600
2017-09-07 11:27JONHMTriggers an Emergency Pack => No
2017-09-07 12:16JONHMSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15843#r15843
2017-09-07 12:16JONHMRelationship addedrelated to 0032677
2017-09-07 13:50aferrazNote Added: 0098886
2017-09-07 13:55aferrazReview Assigned To => aferraz
2017-09-07 13:55aferrazStatusnew => closed
2017-09-07 13:55aferrazResolutionopen => no change required

Notes
(0098886)
aferraz   
2017-09-07 13:50   
When a receipt/shipment line is deleted, following constraint checks are triggered:

Delete on m_inoutline (cost=0.56..8.57 rows=1 width=6) (actual time=3.539..3.539 rows=0 loops=1)
   -> Index Scan using m_inoutline_key on m_inoutline (cost=0.56..8.57 rows=1 width=6) (actual time=0.070..0.077 rows=1 loops=1)
         Index Cond: ((m_inoutline_id)::text = '39248BDAE2B24E03B3A46025E5B28705'::text)
 Trigger for constraint c_invoiceline_m_inoutline: time=1.996 calls=1
 Trigger for constraint c_orderline_inoutline: time=1.744 calls=1
 Trigger for constraint c_projectissue_m_inoutline: time=0.874 calls=1
 Trigger for constraint em_pricm_transaction_inoutline: time=1679.216 calls=1
 Trigger for constraint m_costing_m_inoutline: time=64.115 calls=1
 Trigger for constraint m_inoutline_acctd_fk_inoutline: time=1.028 calls=1
 Trigger for constraint m_inoutline_bomparentid: time=0.429 calls=1
 Trigger for constraint m_inoutline_canceled_inoutline: time=0.410 calls=1
 Trigger for constraint m_lc_receipt_inoutline: time=0.767 calls=1
 Trigger for constraint m_lc_receiptline_amt_inoutline: time=116.975 calls=1
 Trigger for constraint m_matchinv_m_inoutline: time=0.894 calls=1
 Trigger for constraint m_matchpo_m_inoutline: time=3.520 calls=1
 Trigger for constraint m_transaction_m_inoutline: time=0.664 calls=1
 Trigger m_inoutline_trg: time=4.698 calls=1
 Trigger m_ioline_chk_restrictions_trg: time=2.586 calls=1
 Total runtime: 1880.934 ms
(19 rows)

em_pricm_transaction_inoutline constraint takes most of the time.
This constraint belongs to cat.practics.intercompanymovements module.

If we add following index, time goes down from 1.9 seconds to 200 ms.:
CREATE INDEX EM_PRICM_INOUTLINE
  ON m_transaction
  USING btree
  (EM_PRICM_INOUTLINE_ID COLLATE pg_catalog."default")
  WHERE EM_PRICM_INOUTLINE_ID IS NOT NULL;

Delete on m_inoutline (cost=0.56..8.57 rows=1 width=6) (actual time=3.334..3.334 rows=0 loops=1)
   -> Index Scan using m_inoutline_key on m_inoutline (cost=0.56..8.57 rows=1 width=6) (actual time=0.060..0.062 rows=1 loops=1)
         Index Cond: ((m_inoutline_id)::text = '4E570709DAC2433D976E1967F0AE5DB7'::text)
 Trigger for constraint c_invoiceline_m_inoutline: time=1.745 calls=1
 Trigger for constraint c_orderline_inoutline: time=1.813 calls=1
 Trigger for constraint c_projectissue_m_inoutline: time=0.842 calls=1
 Trigger for constraint em_pricm_transaction_inoutline: time=1.064 calls=1
 Trigger for constraint m_costing_m_inoutline: time=65.667 calls=1
 Trigger for constraint m_inoutline_acctd_fk_inoutline: time=0.945 calls=1
 Trigger for constraint m_inoutline_bomparentid: time=0.405 calls=1
 Trigger for constraint m_inoutline_canceled_inoutline: time=0.398 calls=1
 Trigger for constraint m_lc_receipt_inoutline: time=0.759 calls=1
 Trigger for constraint m_lc_receiptline_amt_inoutline: time=113.156 calls=1
 Trigger for constraint m_matchinv_m_inoutline: time=1.272 calls=1
 Trigger for constraint m_matchpo_m_inoutline: time=1.226 calls=1
 Trigger for constraint m_transaction_m_inoutline: time=0.560 calls=1
 Trigger m_inoutline_trg: time=5.304 calls=1
 Trigger m_ioline_chk_restrictions_trg: time=2.269 calls=1
 Total runtime: 198.552 ms
(19 rows)