Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045710Retail ModulesWeb POSpublic2021-01-11 17:442021-01-15 08:32
egoitz 
Sandrahuguet 
normalcriticalalways
closedfixed 
5
 
RR21Q2 
No
0045710: Query to get characteristics model is taking more than 10 minutes.
When executing a full refresh, on an environment with thousands of characteristics, the query is taking more than 10 minutes.

Model: Characteristic Value
Query:
select characteri0_.M_Ch_Value_ID as col_0_0_, characteri0_.Name as col_1_0_, characteri1_.M_Characteristic_ID as col_2_0_, adtreenode2_.Parent_ID as col_3_0_, characteri0_.IsSummary as col_4_0_, characteri0_.Name as col_5_0_, characteri0_.Isactive as col_6_0_, characteri1_.Name as col_7_0_ from M_Ch_Value characteri0_ inner join M_Characteristic characteri1_ on characteri0_.M_Characteristic_ID=characteri1_.M_Characteristic_ID cross join AD_TreeNode adtreenode2_ where characteri1_.AD_Tree_ID=adtreenode2_.AD_Tree_ID and characteri0_.M_Ch_Value_ID=adtreenode2_.Node_ID and characteri0_.IsSummary='N' and (exists (select 1 from M_Product_Ch_Value productcha3_ cross join OBRETCO_Prol_Product obretco_pr4_ where productcha3_.M_Product_ID=obretco_pr4_.M_Product_ID and productcha3_.M_Ch_Value_ID=characteri0_.M_Ch_Value_ID and (obretco_pr4_.Obretco_Productlist_ID in ($1)))) and characteri0_.Isactive='Y' and adtreenode2_.IsActive='Y' and 1=1 and 1=1 and (characteri0_.AD_Client_ID in ('ED6E1C1132D840E2AC6A9932603E09B0' , '0')) and characteri1_.EM_Obpos_Useonwebpos='Y' and characteri0_.Isactive='Y' and (exists (select 1 from AD_Org organizati5_ where (organizati5_.AD_Org_ID in ($2)) and ad_org_isinnaturaltree(characteri0_.AD_Org_ID, organizati5_.AD_Org_ID, characteri0_.AD_Client_ID)='Y')) order by characteri0_.Name, characteri0_.M_Ch_Value_ID limit $3
-Execute a full refresh on an environment with thousandss of products and characteristcs values.
No tags attached.
Issue History
2021-01-11 17:44egoitzNew Issue
2021-01-11 17:44egoitzAssigned To => Retail
2021-01-11 17:44egoitzResolution time => 1610665200
2021-01-11 17:44egoitzTriggers an Emergency Pack => No
2021-01-11 17:44egoitzSeveritymajor => critical
2021-01-11 17:47malsasuaDescription Updatedbug_revision_view_page.php?rev_id=22023#r22023
2021-01-12 12:28adrianromeroAssigned ToRetail => prakashmurugesan88
2021-01-12 12:33prakashmurugesan88Statusnew => scheduled
2021-01-14 18:09hgbotNote Added: 0125472
2021-01-15 08:28hgbotResolutionopen => fixed
2021-01-15 08:28hgbotStatusscheduled => closed
2021-01-15 08:28hgbotFixed in Version => RR21Q2
2021-01-15 08:28hgbotNote Added: 0125475
2021-01-15 08:28hgbotNote Added: 0125476
2021-01-15 08:32SandrahuguetAssigned Toprakashmurugesan88 => Sandrahuguet

Notes
(0125472)
hgbot   
2021-01-14 18:09   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/258 [^]
(0125475)
hgbot   
2021-01-15 08:28   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 8fb67e11385c6764fb9626fcabbcbe2e94815a27
Author: Sandra Huguet <sandra.huguet@openbravo.com>
Date: 2021-01-14T18:06:31+01:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/8fb67e11385c6764fb9626fcabbcbe2e94815a27 [^]

Fixes ISSUE-45710 improve characteristic and characteristicvalue
performance

- orderby only is necessary order by name in remote mode
- if not crossstore use naturalOrgCriteria

---
M src/org/openbravo/retail/posterminal/master/Characteristic.java
M src/org/openbravo/retail/posterminal/master/CharacteristicValue.java
---
(0125476)
hgbot   
2021-01-15 08:28   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/258 [^]