Codessentials

  • Increase font size
  • Default font size
  • Decrease font size
Home Coding tips Oracle Unindexed Foreign keys

Unindexed Foreign keys

Having unindexed foreign keys can cause multiple problems.

Here you find a query to identify foreign keys not having a proper foreign key:

SELECT * FROM (  
SELECT c.table_name, cc.column_name, cc.position column_position
FROM user_constraints c, user_cons_columns cc
WHERE c.constraint_name = cc.constraint_name
AND c.constraint_type = 'R'
MINUS
SELECT i.table_name, ic.column_name, ic.column_position
FROM user_indexes i, user_ind_columns ic
WHERE i.index_name = ic.index_name
)
ORDER BY table_name, column_position;
 

Bookmark

AddThis Social Bookmark Button

Related Articles


Newsflash

Yadis! Backup 1.9.8 is released!

See the new features right here!

Download this version here!