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

Redundant index in mysql5-jbpm-schema.sql

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major 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;

      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.

              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

                Created:
                Updated:
                Resolved: