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

Slow SQL query for getting problems

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 6.0.2, 6.0.3
    • Frontend (F), Server (S)

      We use Zabbix to notify an external dashboard. We send notifications every 5 minutes until the event is closed.I have old event with 1000+ actions.When I tried to see all current problems, to total sql time is greater than 200 sec

      Steps to reproduce:

      1. Go to the monitoring > Problems
        *Result:*
        ******************** Script profiler ********************
        Total time: 229.407166
        Total SQL time: 229.087297
        SQL count: 1453 (selects: 774 | executes: 691)
        Peak memory usage: 34M
        Memory limit: 512M
         
        SQL (200.412189): 
        SELECT COUNT(*) AS rowscount,a.eventid FROM alerts a WHERE EXISTS (SELECT NULL FROM actions aa WHERE a.actionid=aa.actionid AND aa.eventsource='0') AND a.eventid IN (3529764,3529873,3529875,3560887,3589542,3601809,3601815,3601819,3601820,3601821,3601824,3601841,3601850,3610947,3610948,3610950,3610951,3610954,3610955,3610957,3614349,3615811,3646525,3646533,3646554,3646733,3646737,3653434,3653438,3653594,3653599,3653605,3653826,3653834,3653835,3653849,3653854,3653857,3653858,3653862,3653870,3653871,3653872,3653879,3653883,3653900,3653926,3653936,3653949,3653965,3653979,3654166,3654169,3654177,3654179,3654181,3654185,3654188,3654194,3654199,3654202,3654205,3654209,3654211,3654219,3695041,3695052,3695054,3695062,3695073,3695087,3695099,3695253,3695320,3695567,3695568,3695569,3695570,3695572,3698324,3698331,3712695,3718317,3718323,3753468,3753529,3753748,3755376,3763184,3763200,3763201,3763213,3763223,3763233,3763557,3763560,3763561,3763565,3763569,3763575,3763576,3763581,3763582,3763592,3763593,3763603,3763628,3763864,3763900,3763906,3777672,3819506,3820613,3862875,3862958,3863527,3863528,3864267,3870351,4018743,4018997,4108455,4115714,4303340,4504058,4555618,4589979,4591324,4591554,4591651,4592106,4607541,4616596,4619565,4708825,4708945,4711388,4720657,4751732,4751745,4752648,4753353,4753354,4778674,4821761,4880979,4880988,4880990,4882066,4882067,4882068,4887041,4887043,4887067,4887068,4936352,4954130,5007985,5020710,5021153,5021499,5021668,5021714,5021799,5021812,5022132,5026468,5042064,5081539,5120766,5126734,5155512,5187443,5191046,5191770,5228254,5232218,5233902,5262583,5291480,5293166,5293991,5294069,5294995,5295054,5297881,5298002,5298746,5302504,5305133,5312568,5320610,5322427,5323825,5331510,5331892,5332317,5332850,5333140,5333688) GROUP BY a.eventid
        zabbix.php:22 → require_once() → ZBase->run() → ZBase->processRequest() → ZBase->processResponseFinal() → CView->getOutput() → include() → CScreenProblem->get() → CScreenProblem::makeData() → getEventsActionsIconsData() → getEventsAlertsOverview() → CApiWrapper->__call(
        

            zabbix.dev Zabbix Development Team
            Adawid Adawid
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: