Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039378Openbravo ERP02. Master data managementpublic2018-09-17 16:332018-10-02 10:23
JONHM 
AtulOpenbravo 
highmajoralways
closedfixed 
5
 
3.0PR18Q3.23.0PR18Q3.2 
Sandrahuguet
Core
No
0039378: Performance issue in c_bpartner_trg on environment with lots of data
There is a performance issue in c_bpartner_trg on environment with lots of data when changing a BP's price list.
Ask environment to Support:

- Open Business Partner window and select 'CLIENTE MOSTRADOR' BP
- Change it's price list on the selector and save the record

it takes 15517.787 ms to save the record.
Most of the time is spent on the following query:

SELECT MAX(p.c_currency_id)
INTO v_currency_credit
FROM fin_payment p
WHERE p.c_bpartner_id = new.C_BPartner_ID
AND p.generated_credit <> 0
AND p.generated_credit-COALESCE(p.used_credit, 0) <> 0;
No tags attached.
blocks defect 0039305 closed AtulOpenbravo Performance issue in c_bpartner_trg on environment with lots of data 
Issue History
2018-09-28 12:58SandrahuguetTypedefect => backport
2018-09-28 12:58SandrahuguetTarget Version => 3.0PR18Q3.2
2018-10-02 10:21hgbotCheckin
2018-10-02 10:21hgbotNote Added: 0107107
2018-10-02 10:21hgbotStatusscheduled => resolved
2018-10-02 10:21hgbotResolutionopen => fixed
2018-10-02 10:21hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/463468c986a3dd39e77c69f159477422f311ebe1 [^] => http://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/8f54808cff36be7a280e8365ebc2fd5820304450 [^]
2018-10-02 10:23SandrahuguetNote Added: 0107109
2018-10-02 10:23SandrahuguetStatusresolved => closed
2018-10-02 10:23SandrahuguetFixed in Version => 3.0PR18Q3.2

Notes
(0107107)
hgbot   
2018-10-02 10:21   
Repository: erp/backports/3.0PR18Q3.2
Changeset: 8f54808cff36be7a280e8365ebc2fd5820304450
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Thu Sep 27 00:00:16 2018 +0530
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.2/rev/8f54808cff36be7a280e8365ebc2fd5820304450 [^]

Fixes Issue 39378:Performance issue in c_bpartner_trg on environment
with lots of data

** Made use of fin_payment_bpartner_credit index in query
to fetch curreny of the generated credit not yet consumed
in c_bpartner_trg.

---
M src-db/database/model/triggers/C_BPARTNER_TRG.xml
---
(0107109)
Sandrahuguet   
2018-10-02 10:23   
Code review + testing OK