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

redundant queries when modifying a web scenario

XMLWordPrintable

      modify a web scenario. executed queries are a bit strange

      a)
      SELECT p.value_id,p.source FROM profiles p WHERE p.userid=1 AND p.idx='web.httpconf.applications' ORDER BY p.profileid
      DELETE FROM profiles WHERE userid=1 AND idx='web.httpconf.applications'
      SELECT p.value_id,p.source FROM profiles p WHERE p.userid=1 AND p.idx='web.httpconf.applications' ORDER BY p.profileid
      just in case delete silently failed ?

      b)
      SELECT i.nextid FROM ids i WHERE i.nodeid=0 AND i.table_name='profiles' AND i.field_name='profileid'
      UPDATE ids SET nextid=nextid+1 WHERE nodeid=0 AND table_name='profiles' AND field_name='profileid'
      SELECT i.nextid FROM ids i WHERE i.nodeid=0 AND i.table_name='profiles' AND i.field_name='profileid'
      INSERT INTO profiles (profileid, userid, idx, value_id, type) VALUES (139, 1, 'web.httpconf.applications', 356, 1)

      wouldn't it be better to update the record instead of deleting it, updating ids table, then recreating it ?

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

              Created:
              Updated:
              Resolved: