-
Change Request
-
Resolution: Unresolved
-
Major
-
None
-
6.0.40, 7.0.16, 7.2.10, 7.4.1rc1, 8.0.0alpha1 (master)
Many of the widget multiselect or pattern select fields are awfully slow in Zabbix instances that are operating at an Enterprise level. For example, On a system with 7000 hosts and 9,000,000 items typing a pattern in a CWidgetFieldPatternSelectItem box takes 90 seconds or longer (depends on the rarity of the searched string) on advanced hardware (Dell R6525) with flash storage (nVME) and very fast DDR5 RAM. This is not user friendly when creating dashboards and many users will wonder why there is no response.
One strategy could be to implement something similar to the SVG Graph where there is a preselect query against the host patterns entered, but this is not a 100% solution because some widgets might not have any hosts or hostgroups set in the configuration forms. Would it be possible to have a new table that maintains a list of unique item patterns? Or perhaps the underlying API call / database query can be optimized?
Here is the query that runs:
SELECT DISTINCT i.itemid,COALESCE(irn.name_resolved,'') AS name_resolved,i.name FROM hosts h,items i LEFT JOIN item_rtname irn ON i.itemid=irn.itemid WHERE i.flags IN (0,4) AND h.hostid=i.hostid AND h.status<>3 AND ((irn.name_resolved_upper LIKE 'SOMEPATTERN%%' ESCAPE '!')) ORDER BY i.name LIMIT 1000
Simply changing it to the following offers a 10x speedup:
SELECT DISTINCT * FROM item_rtname WHERE name_resolved_upper LIKE '99%ABC%' ESCAPE '!' ORDER BY name_resolved;
I think optimizations like this should be high on the list for making Zabbix the ultimate observability platform.