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

weird sql queries when importing an empty template

    XMLWordPrintable

Details

    • Incident report
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • API (A)

    Description

      have an empty template in xml, import it. several weird and potentially redundant queries :

      1) SELECT g.groupid,g.name FROM groups g WHERE g.name='Templates'

      do we have to select name here ?

      2) SELECT g.groupid FROM groups g WHERE g.groupid='13'

      eh ?

      3)
      SELECT h.hostid,h.host FROM hosts h WHERE h.status=3 AND h.host='empty_template'
      SELECT h.hostid,h.templateid FROM hosts h WHERE h.status=3 AND h.host='empty_template' LIMIT 1 OFFSET 0
      SELECT h.hostid FROM hosts h WHERE h.flags IN (0,4) AND h.status IN (0,1) AND h.host='empty_template' LIMIT 1 OFFSET 0
      SELECT h.hostid,h.templateid FROM hosts h WHERE h.status=3 AND h.name='empty_template' LIMIT 1 OFFSET 0
      SELECT h.hostid FROM hosts h WHERE h.flags IN (0,4) AND h.status IN (0,1) AND h.name='empty_template' LIMIT 1 OFFSET 0

      a) in the first one, we select 'host' even though it's also in the 'where' part
      b) sure we can do a smaller amount of selects here...

      Attachments

        Activity

          People

            Unassigned Unassigned
            richlv richlv
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: