[ZBX-21511] Slow query for Monitoring Problem usser type zabbix user Created: 2022 Aug 25  Updated: 2023 Dec 19  Resolved: 2023 Mar 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 5.0.25
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Carlos Assignee: Zabbix Support Team
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We experience slow query for monitoring-> problems for user type zabbix user and zabbix admin, for zabbix superadmin no issue.

We detected that query is different and times much longer for zabbix user
zabbix user query  13.62 seconds
SQL (13.621241): SELECT p.eventid,p.objectid,p.clock,p.ns,p.name,p.severity FROM problem p WHERE p.source='0' AND p.object='0' AND NOT EXISTS (SELECT NULL FROM functions f,items i,hosts_groups hgg LEFT JOIN rights r ON r.id=hgg.groupid AND r.groupid IN (42,86) WHERE p.objectid=f.triggerid AND f.itemid=i.itemid AND i.hostid=hgg.hostid GROUP BY i.hostid HAVING MAX(permission)<2 OR MIN(permission) IS NULL OR MIN(permission)=0) AND p.severity IN (3,4) AND NOT EXISTS (SELECT NULL FROM event_suppress es WHERE es.eventid=p.eventid) AND (p.r_eventid IS NULL OR p.r_clock>1661340198) ORDER BY p.eventid DESC LIMIT 5001

zabbix superadmin user query 0.11 seconds
SQL (0.119617): SELECT p.eventid,p.objectid,p.clock,p.ns,p.name,p.severity FROM problem p WHERE p.source='0' AND p.object='0' AND p.severity IN (3,4) AND NOT EXISTS (SELECT NULL FROM event_suppress es WHERE es.eventid=p.eventid) AND (p.r_eventid IS NULL OR p.r_clock>1661340841) AND p.clock>='1661254742' ORDER BY p.eventid DESC LIMIT 5001



 Comments   
Comment by Carlos [ 2022 Aug 25 ]

We fix the issue changing /usr/share/zabbix/include/classes/api/services/CProblem.php

definition 
'nopermissions' => null,  CHANGE TO 'nopermissions' => true,

Comment by Carlos [ 2022 Aug 25 ]

We fix the issue changing /usr/share/zabbix/include/classes/api/services/CProblem.php

definition 
'nopermissions' => null,  CHANGE TO 'nopermissions' => true,

Comment by Konstantin Kornienko [ 2023 Dec 18 ]

We're experiencing very similar problem after upgrading from Zabbix 4 to Zabbix 6.

But in our case it takes more than 1 minute to execute that query.

@Verbo, @zalex_ua , can you please advise - this change in CProblem.php - is it just a workaround or a final solution?

Thanks!

 

Comment by Konstantin Kornienko [ 2023 Dec 19 ]

Looks like related to https://support.zabbix.com/browse/ZBXNEXT-5878

Generated at Sat Apr 04 06:46:11 EEST 2026 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.