Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-7875

Redundant index in mysql5-jbpm-schema.sql

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.14.0.Final
    • 7.12.0.Final
    • Installer
    • NEW
    • NEW
    • Hide
      • Run mysql5-jbpm-schema.sql
      • View indexes. For example,
        select table_name,index_name,column_name from information_schema.statistics where table_schema = "my_schema_name" order by table_name, column_name;
        
      Show
      Run mysql5-jbpm-schema.sql View indexes. For example, select table_name,index_name,column_name from information_schema.statistics where table_schema = "my_schema_name" order by table_name, column_name;

    Description

      If we use mysql5-jbpm-schema.sql (https://github.com/kiegroup/jbpm/blob/7.12.0.Final/jbpm-installer/src/main/resources/db/ddl-scripts/mysql5/mysql5-jbpm-schema.sql), we will see redundant indexes on many columns.

      For example,

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

      table_name index_name column_name

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

      attachment FK_7ndpfa311i50bq7hy18q05va3 attachedBy_id
      attachment IDX_Attachment_Id attachedBy_id

      This is because mysql5-jbpm-schema.sql creates an index on FK.

      ~~~
      alter table Attachment
      add index FK_7ndpfa311i50bq7hy18q05va3 (attachedBy_id),
      add constraint FK_7ndpfa311i50bq7hy18q05va3
      foreign key (attachedBy_id)
      references OrganizationalEntity (id);
      ~~~

      and creates one more index for the same column.

      ~~~
      create index IDX_Attachment_Id ON Attachment(attachedBy_id);
      ~~~

      Such redundant indexes may decrease the database performance.

      Attachments

        Issue Links

          Activity

            People

              elguardian@gmail.com Enrique González Martínez (Inactive)
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: