Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||||||||
View Issue Details | |||||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||||||
0033132 | Openbravo ERP | A. Platform | public | 2016-06-03 17:05 | 2016-06-08 13:33 | ||||||||||||||
Reporter | shuehner | ||||||||||||||||||
Assigned To | platform | ||||||||||||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||||||||||||
Status | closed | Resolution | duplicate | ||||||||||||||||
Platform | OS | 5 | OS Version | ||||||||||||||||
Product Version | |||||||||||||||||||
Target Version | Fixed in Version | ||||||||||||||||||
Merge Request Status | |||||||||||||||||||
Review Assigned To | |||||||||||||||||||
OBNetwork customer | |||||||||||||||||||
Web browser | |||||||||||||||||||
Modules | Core | ||||||||||||||||||
Support ticket | |||||||||||||||||||
Regression level | |||||||||||||||||||
Regression date | |||||||||||||||||||
Regression introduced in release | |||||||||||||||||||
Regression introduced by commit | |||||||||||||||||||
Triggers an Emergency Pack | No | ||||||||||||||||||
Summary | 0033132: OBCriteria (at least sometimes) add client + org filters twice | ||||||||||||||||||
Description | OBCriteria by default automatically adds 3 typically used filters to the SQL it is building a.) ad_client (in list of readable clients) b.) ad_org (in list of readable organizations) c.) isactive = 'Y' Reviewing SQL generated at least in some cases it adds all those filters 2 times. That is bad for at least: a.) CPU time overhead in processing those double queries in (sql parse + bind stages) b.) Makes reviewing i.e. postgresql logfile containing all queries for debugging at lot more difficult. Example of SQL being generated: select this_.AD_Message_ID as AD1_59_0_, many_other_columns from AD_Message this_ where lower(this_.Value)=$1 and this_.AD_Org_ID in ($2, $3, $4, $5, $6, $7, $8, $9) and this_.AD_Client_ID in ($10, $11) and this_.IsActive=$12 and this_.AD_Org_ID in ($13, $14, $15, $16, $17, $18, $19, $20) and this_.AD_Client_ID in ($21, $22) and this_.IsActive=$23 limit $24 | ||||||||||||||||||
Steps To Reproduce | Easy why to see the wrong behavior is to run OBMessageUtils.messageBD function for example with a simple junit testcase. @Test public void testADMessage() { log.info(OBMessageUtils.messageBD("OrderDocumentno")); } And review all sql triggered by it (i.e. on postgres set log_min_duration_statement=0 in config) | ||||||||||||||||||
Proposed Solution | Do not double add the filters when building the SQL. | ||||||||||||||||||
Additional Information | |||||||||||||||||||
Tags | Performance | ||||||||||||||||||
Relationships |
| ||||||||||||||||||
Attached Files | |||||||||||||||||||
Issue History | |||||||||||||||||||
Date Modified | Username | Field | Change | ||||||||||||||||
2016-06-03 17:05 | shuehner | New Issue | |||||||||||||||||
2016-06-03 17:05 | shuehner | Assigned To | => platform | ||||||||||||||||
2016-06-03 17:05 | shuehner | Modules | => Core | ||||||||||||||||
2016-06-03 17:05 | shuehner | Triggers an Emergency Pack | => No | ||||||||||||||||
2016-06-03 17:14 | shuehner | Tag Attached: Performance | |||||||||||||||||
2016-06-03 17:14 | shuehner | Relationship added | related to 0033133 | ||||||||||||||||
2016-06-05 14:54 | shuehner | Relationship added | related to 0033138 | ||||||||||||||||
2016-06-06 15:12 | shuehner | Note Added: 0087033 | |||||||||||||||||
2016-06-08 13:33 | shuehner | Relationship replaced | duplicate of 0033138 | ||||||||||||||||
2016-06-08 13:33 | shuehner | Note Added: 0087094 | |||||||||||||||||
2016-06-08 13:33 | shuehner | Status | new => closed | ||||||||||||||||
2016-06-08 13:33 | shuehner | Resolution | open => duplicate |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|