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

Missing index causing full table scan on escalations table during recovery

XMLWordPrintable

    • Team A
    • Sprint 40, Sprint 41, Sprint 42, Sprint 43
    • 0.5

      When syncing history and problem gets recovered, then history syncer will do full table scan.

      explain select actionid,eventid,escalationid from escalations where eventid=2010;
      +------+-------------+-------------+------+---------------+------+---------+------+------+-------------+
      | id   | select_type | table       | type | possible_keys | key  | key_len | ref  | rows | Extra       |
      +------+-------------+-------------+------+---------------+------+---------+------+------+-------------+
      |    1 | SIMPLE      | escalations | ALL  | NULL          | NULL | NULL    | NULL | 1000 | Using where |
      +------+-------------+-------------+------+---------------+------+---------+------+------+-------------+
      1 row in set (0.00 sec)
      

      In 3.0 it was a little bit better

       explain select actionid,triggerid,itemid from escalations where eventid is not null and actionid=3;
      +------+-------------+-------------+------+---------------+---------------+---------+-------+------+-------------+
      | id   | select_type | table       | type | possible_keys | key           | key_len | ref   | rows | Extra       |
      +------+-------------+-------------+------+---------------+---------------+---------+-------+------+-------------+
      |    1 | SIMPLE      | escalations | ref  | escalations_1 | escalations_1 | 8       | const |    1 | Using where |
      +------+-------------+-------------+------+---------------+---------------+---------+-------+------+-------------+
      

      Suggested

      CREATE INDEX escalations_2 ON escalations (`eventid`);
      

            vso Vladislavs Sokurenko
            vso Vladislavs Sokurenko
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: