Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-15399

Use index with DELETEQUERYSTR query in GenericTableHandler

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.0, 7.1.0
    • Fix Version/s: 7.1.0
    • Component/s: None
    • Labels:
    • Target Version/s:
    • Story Points:
      2
    • Sprint:
      2020.13 - IDM

      Description

      The DELETEQUERYSTR query in GenericTableHandler does not have the proper ordering in the WHERE clause to take advantage of an index.

      The index shows that objecttypes_id should be moved to the front of the WHERE clause:

              result.put(QueryDefinition.DELETEQUERYSTR, "DELETE FROM " + mainTable
                      + " WHERE objectid = ${objectid} and rev = ${rev} and objecttypes_id = ${long:objecttypeid}");
      

      For example MySQL has the index:

      UNIQUE INDEX `idx_genericobjects_object` (`objecttypes_id` ASC, `objectid` ASC) ,
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                travis.haagen Travis Haagen
                Reporter:
                travis.haagen Travis Haagen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: