Openbravo Issue Tracking System - Modules
View Issue Details
0045702ModulesExternal Data Integrationpublic2021-01-08 09:532023-07-04 12:35
javietxe 
Triage Platform Base 
normalmajorhave not tried
newopen 
5
 
 
0045702: Optimisation in query in EDL
More detailed information:
https://docs.google.com/document/d/1zkFyolgmkhN3iVXfHtXmJ6eZemmfEYrHEY9fScXGkPE/edit?usp=sharing [^]

In ProcessRequest class, there exists this query. The “Or” condition is slowing down processing of “EDL Request” and CPU/mem consumption under heavy load with a lot of data in “OBEDL_Request_Line“ table.

 hql = new StringBuilder();
    hql.append(" select count(*) from ").append(OBEDLRequestLine.ENTITY_NAME);
    hql.append(" where ").append(OBEDLRequestLine.PROPERTY_EDLREQUEST).append(" = :request");
    hql.append(" and (");
    hql.append(OBEDLRequestLine.PROPERTY_STATUS)
        .append(" = '")
        .append(REQUEST_STATUS_PROCESSING)
        .append("'");
    hql.append(" or ")
        .append(OBEDLRequestLine.PROPERTY_STATUS)
        .append(" = '")
        .append(STATUS_SCHEDULED)
        .append("'");
    hql.append(" )");
N/A
StringBuilder sql = new StringBuilder();
    sql.append("SELECT sum(CASE WHEN ")
        .append(OBEDLRequestLine.PROPERTY_STATUS)
        .append(" = '")
        .append(REQUEST_STATUS_PROCESSING)
        .append("'")
        .append(" THEN 1 ")
        .append(" WHEN ")
        .append(OBEDLRequestLine.PROPERTY_STATUS)
        .append(" = '")
        .append(STATUS_SCHEDULED)
        .append("'")
        .append(" THEN 1 ")
        .append(" ELSE 0 END) as nbvalue")
        .append(" FROM ")
        .append(OBEDLRequestLine.ENTITY_NAME)
        .append(" where ")
        .append("obedl_request_id").append(" = '").append(request.getId()).append("'");
No tags attached.
Issue History
2021-01-08 09:53javietxeNew Issue
2021-01-08 09:53javietxeAssigned To => platform
2021-01-08 09:53javietxeResolution time => 1611874800
2022-02-01 08:07alostaleAssigned Toplatform => Triage Platform Base

There are no notes attached to this issue.