-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
3.0.1
-
Centos 7, MariaDB 5.5
After upgrading from zabbix 2.2 to 3.0.1 sql server is killed by those queries
MariaDB [zabbix]> SELECT e.* FROM events e WHERE e.objectid IN ('13469','14813','15092','15239','17815','18368','18724','21712','21715','21716','22077','22402','22406','23391','24575','24578','28130','29683','39991','45773','45776','46096','47023','47136','48127') AND e.object='0' AND e.source='0' AND e.value IN ('0','1') ORDER BY e.clock DESC,e.eventid DESC LIMIT 25 OFFSET 0; +----------+--------+--------+----------+------------+-------+--------------+-----------+ | eventid | source | object | objectid | clock | value | acknowledged | ns | +----------+--------+--------+----------+------------+-------+--------------+-----------+ | 30258810 | 0 | 0 | 46096 | 1458035600 | 0 | 0 | 25 rows in set (48.00 sec)
explain seems ok
*************************** 1. row *************************** id: 1 select_type: SIMPLE table: e type: index possible_keys: events_1,events_2 key: events_2 key_len: 12 ref: NULL rows: 25035 Extra: Using where
removing e.clock also makes this query fast
also replacing IN ( with a series of queries is fast