Openbravo Issue Tracking System - Modules |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0047331 | Modules | French Fiscal | public | 2021-07-05 13:54 | 2023-11-15 10:03 |
|
Reporter | vmromanos | |
Assigned To | vmromanos | |
Priority | normal | Severity | minor | Reproducibility | have not tried |
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 | |
Support ticket | |
OBNetwork customer | |
Regression introduced in release | |
|
Summary | 0047331: Improve performance FrenchFiscalSecurityManager |
Description | In a HV environment the following queries have been detected as slow:
select distinct obcfr_tick0_.Obpos_Applications_ID as col_0_0_ from OBCFR_Ticket obcfr_tick0_ where obcfr_tick0_.AD_Client_ID=$1
select distinct obcfr_tick0_.Obpos_Applications_ID as col_0_0_ from OBCFR_TicketTax obcfr_tick0_ where obcfr_tick0_.AD_Client_ID=$1
select distinct obcfr_tick0_.Obpos_Applications_ID as col_0_0_ from OBCFR_TicketReprint obcfr_tick0_ where obcfr_tick0_.AD_Client_ID=$1
select distinct obcfr_term0_.Obpos_Applications_ID as col_0_0_ from OBCFR_TerminalMonitor obcfr_term0_ where obcfr_term0_.AD_Client_ID=$1
select distinct obcfr_tick0_.Obpos_Applications_ID as col_0_0_ from OBCFR_Ticket_AggDay obcfr_tick0_ where obcfr_tick0_.AD_Client_ID=$1
select distinct obcfr_tick0_.Obpos_Applications_ID as col_0_0_ from OBCFR_Ticket_AggMonth obcfr_tick0_ where obcfr_tick0_.AD_Client_ID=$1
select distinct obcfr_tick0_.Obpos_Applications_ID as col_0_0_ from OBCFR_Ticket_AggYear obcfr_tick0_ where obcfr_tick0_.AD_Client_ID=$1
These queries are related to the FrenchFiscalSecurityManager class
|
Steps To Reproduce | NA |
Proposed Solution | 1. Create an index on [AD_CLIENT_ID, Obpos_Applications_ID] for each of the affected tables and see if there are improvements. Other alternative is to create an index over [Obpos_Applications_ID] and remove the filter over the AD_Client_ID in the queries.
2. Optionally, consider filtering by terminal's isBlockchained flag where applicable |
Additional Information | |
Tags | NOR |
Relationships | has duplicate | defect | 0049691 | | closed | egoitz | Openbravo Localizations | Some queries are slow, and read lot of information from disk on environment with millioins of transation. | related to | defect | 0053940 | | closed | vmromanos | Modules | Improve performance FrenchFiscalSecurityManager |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2021-07-05 13:54 | vmromanos | New Issue | |
2021-07-05 13:54 | vmromanos | Assigned To | => Triage Finance |
2021-07-08 12:10 | aferraz | Description Updated | bug_revision_view_page.php?rev_id=22856#r22856 |
2021-07-14 10:54 | rafaroda | Tag Attached: NOR | |
2021-07-14 11:20 | shuehner | Issue Monitored: shuehner | |
2021-08-31 11:14 | vmromanos | Status | new => scheduled |
2021-08-31 11:14 | vmromanos | Assigned To | Triage Finance => vmromanos |
2021-08-31 12:42 | hgbot | Note Added: 0131457 | |
2021-08-31 13:20 | hgbot | Note Added: 0131459 | |
2021-08-31 13:20 | hgbot | Resolution | open => fixed |
2021-08-31 13:20 | hgbot | Status | scheduled => closed |
2021-08-31 13:20 | hgbot | Note Added: 0131460 | |
2021-09-15 17:12 | hgbot | Note Added: 0131830 | |
2023-03-20 13:34 | aferraz | Relationship added | has duplicate 0049691 |
2023-11-15 10:03 | egoitz | Issue cloned | 0053940 |
2023-11-15 10:03 | egoitz | Relationship added | related to 0053940 |
Notes |
|
(0131457)
|
hgbot
|
2021-08-31 12:42
|
|
|
|
(0131459)
|
hgbot
|
2021-08-31 13:20
|
|
|
|
(0131460)
|
hgbot
|
2021-08-31 13:20
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.certification.france.dev [^]
Changeset: cc55b8f1f4bb8212985b330518684ba19508f114
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-08-31T12:40:17+02:00
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.certification.france.dev/-/commit/cc55b8f1f4bb8212985b330518684ba19508f114 [^]
Fixed ISSUE-47331: New index to improve FrenchFiscalSecurityManager performance
The FrenchFiscalSecurityManager is run on a daily basis and executes some
queries in OBCFR_* tables, filtering by AD_Client_ID, and creating seq. scans.
The fix adds a new index [AD_CLIENT_ID, Obpos_Applications_ID] over these tables
so the DB can use an "Index Only Scan" instead. In a testing environment with
50k records, the time to execute the same query has improved from 16ms to 0.04ms.
Adding the index is an easy solution that avoids to change the
FrenchFiscalSecurityManager code, and therefore a new certification process.
---
M src-db/database/model/tables/OBCFR_TERMINALMONITOR.xml
M src-db/database/model/tables/OBCFR_TICKET.xml
M src-db/database/model/tables/OBCFR_TICKETREPRINT.xml
M src-db/database/model/tables/OBCFR_TICKETTAX.xml
M src-db/database/model/tables/OBCFR_TICKET_AGGDAY.xml
M src-db/database/model/tables/OBCFR_TICKET_AGGMONTH.xml
M src-db/database/model/tables/OBCFR_TICKET_AGGYEAR.xml
---
|
|
|
(0131830)
|
hgbot
|
2021-09-15 17:12
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.certification.france.dev [^]
Changeset: cc55b8f1f4bb8212985b330518684ba19508f114
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 2021-08-31T12:40:17+02:00
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.certification.france.dev/-/commit/cc55b8f1f4bb8212985b330518684ba19508f114 [^]
Fixed ISSUE-47331: New index to improve FrenchFiscalSecurityManager performance
The FrenchFiscalSecurityManager is run on a daily basis and executes some
queries in OBCFR_* tables, filtering by AD_Client_ID, and creating seq. scans.
The fix adds a new index [AD_CLIENT_ID, Obpos_Applications_ID] over these tables
so the DB can use an "Index Only Scan" instead. In a testing environment with
50k records, the time to execute the same query has improved from 16ms to 0.04ms.
Adding the index is an easy solution that avoids to change the
FrenchFiscalSecurityManager code, and therefore a new certification process.
---
M src-db/database/model/tables/OBCFR_TERMINALMONITOR.xml
M src-db/database/model/tables/OBCFR_TICKET.xml
M src-db/database/model/tables/OBCFR_TICKETREPRINT.xml
M src-db/database/model/tables/OBCFR_TICKETTAX.xml
M src-db/database/model/tables/OBCFR_TICKET_AGGDAY.xml
M src-db/database/model/tables/OBCFR_TICKET_AGGMONTH.xml
M src-db/database/model/tables/OBCFR_TICKET_AGGYEAR.xml
---
|
|