Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0027046
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2014-07-10 18:592014-08-08 18:53
ReporterjecharriView Statuspublic 
Assigned Toshankarb 
PriorityimmediateResolutionfixedFixed in Version3.0PR14Q4
StatusclosedFix in branchFixed in SCM revisiond81b1159aded
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Web browserGoogle Chrome
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0027046: Product simple selector is executing a query in database without limit

DescriptionProduct simple selector is executing a query in database without limit
Steps To Reproduce-Login as "system" and go to "tables and columns"
-Select table "c_orderline" and column "m_product_id"
-Change the column reference to "OBUISEL selector reference" and set "Product simple" selector
-Stop tomcat
-Edit "log4j.lcf" file to display sql queries to be executed
log4j.logger.org.hibernate.SQL=debug, HB
-Compile
-Start tomcat
-Login as "Admin"
-Go to window "sales order" create a header and press new line
-Click in the selector to display all the products

If you go to eclipse console or openbravo.log file, you will see that at this moment SQL query is executed in database without limit

This is a big performance problem when you have more than 1 million of products.
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0068582)
AugustoMauch (manager)
2014-07-10 19:16

This is reproducible with all Custom Query selectors.

The query is done twice, first without a limit, then with a limit:

select businesspa0_.Name as col_0_0_, businesspa0_.C_BPartner_ID as col_1_0_, businesspa0_.Value as col_2_0_, businesspa0_.SO_CreditLimit-businesspa0_.SO_CreditUsed as col_3_0_, businesspa0_.SO_CreditUsed as col_4_0_, businesspa0_.IsCustomer as col_5_0_, businesspa0_.IsVendor as col_6_0_, businesspa1_.Name as col_7_0_ from C_BPartner businesspa0_, C_BP_Group businesspa1_ where businesspa0_.C_BP_Group_ID=businesspa1_.C_BP_Group_ID and (businesspa0_.AD_Client_ID in ('0' , '7273232E589944E3B2C314CCFA24CE51')) and (businesspa0_.AD_Org_ID in ('93026108D6314843BDAF1E2C9582029E' , '0' , 'C9040AD8D77642D98F89A5201E1EE1F5' , '77A6A6E722384AF884E80AC54D0E9A14')) and businesspa0_.IsCustomer='Y' and businesspa0_.IsSummary='N' and businesspa0_.IsActive='Y' order by 1

select businesspa0_.Name as col_0_0_, businesspa0_.C_BPartner_ID as col_1_0_, businesspa0_.Value as col_2_0_, businesspa0_.SO_CreditLimit-businesspa0_.SO_CreditUsed as col_3_0_, businesspa0_.SO_CreditUsed as col_4_0_, businesspa0_.IsCustomer as col_5_0_, businesspa0_.IsVendor as col_6_0_, businesspa1_.Name as col_7_0_ from C_BPartner businesspa0_, C_BP_Group businesspa1_ where businesspa0_.C_BP_Group_ID=businesspa1_.C_BP_Group_ID and (businesspa0_.AD_Client_ID in ('0' , '7273232E589944E3B2C314CCFA24CE51')) and (businesspa0_.AD_Org_ID in ('93026108D6314843BDAF1E2C9582029E' , '0' , 'C9040AD8D77642D98F89A5201E1EE1F5' , '77A6A6E722384AF884E80AC54D0E9A14')) and businesspa0_.IsCustomer='Y' and businesspa0_.IsSummary='N' and businesspa0_.IsActive='Y' order by 1 limit ?

The unlimited query is done here [1], to calculate the total number of rows.

[1] https://code.openbravo.com/erp/devel/pi/file/8b0eab71cd09/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java#l113 [^]
(0068586)
shankarb (reporter)
2014-07-11 08:46

fix pushed to try.
(0068591)
hgbot (developer)
2014-07-11 13:10

Repository: erp/devel/pi
Changeset: d81b1159aded47b55a410419fbcce1c5c807111f
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Fri Jul 11 12:14:31 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/d81b1159aded47b55a410419fbcce1c5c807111f [^]

Fixes Issue 27046: Product simple selector is executing a query in database without limit

When data is fetched in custom query selector the data was iterated to get the number of rows.
This operation is avoided and the total rows is set based on the resultSet iterated later.

---
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java
---
(0068598)
AugustoMauch (manager)
2014-07-14 09:57

Code reviewed and verified in pi@119c05bb76af
(0069152)
hudsonbot (developer)
2014-08-08 18:53

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/4450016dee64 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2014-07-10 18:59 jecharri New Issue
2014-07-10 18:59 jecharri Assigned To => AugustoMauch
2014-07-10 18:59 jecharri Web browser => Google Chrome
2014-07-10 18:59 jecharri Modules => Core
2014-07-10 18:59 jecharri Resolution time => 1405116000
2014-07-10 18:59 jecharri Triggers an Emergency Pack => No
2014-07-10 18:59 jecharri Web browser Google Chrome => Google Chrome
2014-07-10 18:59 jecharri Steps to Reproduce Updated View Revisions
2014-07-10 19:16 AugustoMauch Note Added: 0068582
2014-07-11 08:05 shankarb Assigned To AugustoMauch => shankarb
2014-07-11 08:46 shankarb Status new => scheduled
2014-07-11 08:46 shankarb Note Added: 0068586
2014-07-11 08:46 shankarb fix_in_branch => pi
2014-07-11 09:25 alostale Tag Attached: Performance
2014-07-11 13:09 shankarb Review Assigned To => AugustoMauch
2014-07-11 13:09 shankarb Web browser Google Chrome => Google Chrome
2014-07-11 13:09 shankarb fix_in_branch pi =>
2014-07-11 13:09 shankarb Issue Monitored: AugustoMauch
2014-07-11 13:10 hgbot Checkin
2014-07-11 13:10 hgbot Note Added: 0068591
2014-07-11 13:10 hgbot Status scheduled => resolved
2014-07-11 13:10 hgbot Resolution open => fixed
2014-07-11 13:10 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d81b1159aded47b55a410419fbcce1c5c807111f [^]
2014-07-14 09:57 AugustoMauch Note Added: 0068598
2014-07-14 09:57 AugustoMauch Status resolved => closed
2014-07-14 09:57 AugustoMauch Fixed in Version => PR14Q4
2014-08-08 18:53 hudsonbot Checkin
2014-08-08 18:53 hudsonbot Note Added: 0069152


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker