[ZBX-14720] Missing index causing full table scan on escalations table during recovery Created: 2018 Aug 13 Updated: 2024 Apr 10 Resolved: 2018 Sep 19 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 3.4.12, 4.0.0alpha9 |
Fix Version/s: | 4.0.0rc1, 4.0 (plan) |
Type: | Problem report | Priority: | Trivial |
Reporter: | Vladislavs Sokurenko | Assignee: | Vladislavs Sokurenko |
Resolution: | Fixed | Votes: | 0 |
Labels: | escalations, eventid, history, index, recovery, slow | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
||||||||
Team: | Team A | ||||||||
Sprint: | Sprint 40, Sprint 41, Sprint 42, Sprint 43 | ||||||||
Story Points: | 0.5 |
Description |
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`); |
Comments |
Comment by Vladislavs Sokurenko [ 2018 Sep 10 ] |
Fixed in: |
Comment by Vladislavs Sokurenko [ 2018 Sep 13 ] |
Fixed in:
|