I I think it is good idea to have foreign keys and also have matching indexes. Following script will take care of indexes you missed. It will show you which indexes are missing even for compound foreign keys. But you should check existing indexes just to be sure you are not creating useless index. WITH f AS ( SELECT t.table_name, t.constraint_name AS index_name, LISTAGG(t.column_name, ', ') WITHIN GROUP (ORDER BY t.position) AS fk_cols FROM user_cons_columns t JOIN user_constraints n ON n.constraint_name = t.constraint_name WHERE n.constraint_type = 'R' GROUP BY t.table_name, t.constraint_name ) SELECT f.table_name, f.index_name, f.fk_cols, i.index_name AS existing_index, i.cols AS index_cols, -- 'CREATE INDEX ' || RPAD(f.index_name, 30) || ' ON ' || RPAD(f.table_name, 30) || ' (' || f.fk_cols
Mainly APEX, sometimes SQL, PL/SQL, clean code and certifications