Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-28706

Foreign Keys Constraints created without accompanying index

XMLWordPrintable

      #ORACLE
      SELECT
          a.constraint_name                   cons_name ,
          a.table_name                        tab_name ,
          b.column_name                       cons_column ,
          NVL(c.column_name,'***No Index***') ind_column
      FROM
          user_constraints a
      JOIN
          user_cons_columns b
      ON
          a.constraint_name = b.constraint_name
      LEFT OUTER JOIN
          user_ind_columns c
      ON
          b.column_name = c.column_name
      AND b.table_name = c.table_name
      WHERE
          constraint_type = 'R' and
          c.column_name is null
      ORDER BY
          2,1;
      

      Result set is attached to screenshot. Seems that we have foreign keys that are not also indexed, which may impact performance

            Unassigned Unassigned
            twong Tim Wong (Inactive)
            Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: