I find a particular mysql query causing the CPU usage shooting up to 90%. The query is as below. we tried to fail over zabbix mysql db01 to db02 but dint see any improvement w.r.t cpu usage. failed it back to db01. Eventually, the CPU usage reduced to normalcy. I just wonder if anyone come across such issue and what should be action item on this. Please excuse for insufficient info but I am willing to learn and fix this.
select distinct t.triggerid,t.description,t.expression,t.error,t.p riority,t.type,t.value,t.state,t.lastchange,t.stat us,
t.recovery_mode,t.recovery_expression,t.correlatio n_mode,t.correlation_tag from hosts h,items i,functions f,
triggers t where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and h.status in (0,1) and t.flags<>2"
select distinct t.triggerid,t.description,t.expression,t.error,t.p riority,t.type,t.value,t.state,t.lastchange,t.stat us,
t.recovery_mode,t.recovery_expression,t.correlatio n_mode,t.correlation_tag from hosts h,items i,functions f,
triggers t where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and h.status in (0,1) and t.flags<>2"