Menu

Optimize OQL query

Marah Alh
2024-09-25
4 days ago
  • Marah Alh

    Marah Alh - 2024-09-25

    Hi,
    I use this OQL query in portal (<oql_view> tag )</oql_view>

    SELECT UserRequest AS r WHERE r.caller_id =1 OR r.agent_id=1
    UNION
    SELECT UserRequest AS r JOIN Team AS t ON r.team_id=t.id JOIN lnkPersonToTeam AS l ON l.team_id=t.id WHERE l.person_id=1
    UNION
    SELECT UserRequest AS r2 JOIN Person AS p2 ON r2.caller_id=p2.id JOIN Person AS u11 ON p2.manager_id=u11.id WHERE p2.manager_id=1
    UNION
    SELECT UserRequest AS r2 JOIN Person AS p2 ON r2.agent_id=p2.id JOIN Person AS u11 ON p2.manager_id=u11.id WHERE p2.manager_id=1
    I noticed after read mariadb query log that this query slow the portal performance.
    Is there any solution to optimize this query?
    thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.