XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 1.8.14
    • Frontend (F)
    • freebsd 9, mysql,

      when i saw the slow query log of my GUI server i found the following query,. i take along time about 13Sec.
      how can i improve my DB setting to solve this issue?

      > SELECT DISTINCT t.* FROM triggers t,functions f,items i,hosts_groups hg,rights r,users_groups ug WHERE ((t.triggerid BETWEEN 000000000000000 AND 099999999999999)) AND f.triggerid=t.triggerid AND f.itemid=i.itemid AND hg.hostid=i.hostid AND r.id=hg.groupid AND r.groupid=ug.usrgrpid AND ug.userid=21 AND r.permission>=2 AND NOT EXISTS( SELECT ff.triggerid FROM functions ff, items ii WHERE ff.triggerid=t.triggerid AND ff.itemid=ii.itemid AND EXISTS( SELECT hgg.groupid FROM hosts_groups hgg, rights rr, users_groups gg WHERE hgg.hostid=ii.hostid AND rr.id=hgg.groupid AND rr.groupid=gg.usrgrpid AND gg.userid=21 AND rr.permission<2)) AND NOT EXISTS ( SELECT ff.functionid FROM functions ff WHERE ff.triggerid=t.triggerid AND EXISTS ( SELECT ii.itemid FROM items ii, hosts hh WHERE ff.itemid=ii.itemid AND hh.hostid=ii.hostid AND ( ii.status<>0 OR hh.status<>0 ) ) ) AND t.status=0 AND ( UPPER(t.description) LIKE '%WEAK%' ESCAPE '!' ) AND ((t.value=1) OR ((t.value=0) AND (t.lastchange>1347100034))) ORDER BY t.lastchange DESC ;
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      triggerid expression description url status value priority lastchange dep_level comments error templateid type

      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      162896 {TRIGGER.VALUE}=0&{1136428}>3|{TRIGGER.VALUE}

      =1&

      {1136429}

      #0

      {HOSTNAME}

      Packet Loss [REACH][WEAK]

        0 1 1 1347104320 1 {TRIGGER.VALUE}=0&{Template_DEV_PCKLOS_RESTIME:icmppingloss[{HOST.CONN},3,450,32,500].avg(300)}>3|{TRIGGER.VALUE}

      =1&

      {Template_DEV_PCKLOS_RESTIME:icmppingloss[{HOST.CONN},3,450,32,500].avg(600)}

      #0

        162894 0

      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      1 row in set (13.60 sec)

            Unassigned Unassigned
            white_wire hamid sfandiari
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: