• Icon: Change Request Change Request
    • Resolution: Fixed
    • Icon: Critical Critical
    • None
    • None
    • Server (S)
    • Team A
    • Sprint 26

      A primary key in the database can be shown to have significant performance benifits, particularly in a database engine such as InnoDB or Tokudb which clusters the row based on this index.

      However it is not currently possible to use a primary key in the history* tables due to the server occasionally attempting to insert the same row twice.

      A simple protection against this is to add in zbx_db_insert_execute

      #ifdef HAVE_MYSQL
      	zbx_strcpy_alloc(&sql_command, &sql_command_alloc, &sql_command_offset, " ON DUPLICATE KEY UPDATE value=VALUE(value)");

      This should have no (negative) effect on the current schema, however allows experts to modify their schema possibly with a primary key.

            Unassigned Unassigned
            splitice Mathew
            Team A
            23 Vote for this issue
            33 Start watching this issue