Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-8895

Slow query while using triggers info widget on a screen

    XMLWordPrintable

    Details

      Description

      Zabbix uses the next query for getting overview by trigger priority and status:

      mysql> explain SELECT t.priority,t.value,count(DISTINCT t.triggerid) AS cnt FROM triggers t WHERE t.triggerid BETWEEN '13040' AND '13045' OR t.triggerid BETWEEN '26416' AND '26421' OR t.triggerid BETWEEN '26659' AND '26664' OR t.triggerid BETWEEN '26692' AND '26697' GROUP BY t.priority,t.value;
      +----+-------------+-------+-------+---------------+---------+---------+------+------+-----------------------------+
      | id | select_type | table | type  | possible_keys | key     | key_len | ref  | rows | Extra                       |
      +----+-------------+-------+-------+---------------+---------+---------+------+------+-----------------------------+
      |  1 | SIMPLE      | t     | range | PRIMARY       | PRIMARY | 8       | NULL |    4 | Using where; Using filesort |
      +----+-------------+-------+-------+---------------+---------+---------+------+------+-----------------------------+
      1 row in set (0.01 sec)
      

      The query is very slow when an installation has more than 1 million triggers.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            dotneft Alexey Pustovalov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: