[ZBX-19460] High-load Frontend Query Created: 2021 May 26 Updated: 2024 May 02 |
|
Status: | Need info |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 5.0.11, 6.0.28 |
Fix Version/s: | None |
Type: | Problem report | Priority: | Major |
Reporter: | Igor Gorbach (Inactive) | Assignee: | Aleksandrs Petrovs-Gavrilovs |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
||||||||
Sprint: | Support backlog |
Description |
On huge non-partitioned history* tables query like SELECT itemid,COUNT(*) AS count,AVG(value) AS avg,MIN(value) AS min,MAX(value) AS max,round(1552* MOD(CAST(clock AS UNSIGNED)+3314,8986)/(8986),0) AS i,MAX(clock) AS clock FROM history_uint WHERE itemid='2122261' AND clock>='1620028710' AND clock<='1620037696' GROUP BY itemid,round(1552* MOD(CAST(clock AS UNSIGNED)+3314,8986)/(8986),0); from function running for a more than 30 seconds and create a huge load on database I guess, the root reason is max(), min() and avg() functions usage I guess too, that partitioning could help here, because table will scanning for one or several partitions, not a full table, but Is it possible to optimize this frontend SQL query some way?
|