Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [Q] Foreign keys and indexes
Hi Matthias,
>ALTER TABLE EMP
>ADD CONSTRAINT EMP_FK
>FOREIGN KEY (DEPTNO) REFERENCES DEPT (DEPTNO)
>;
>CREATE INDEX TEST ON EMP (DEPTNO, EXTRA_FIELD);
>
>Would do your job though I'm in doubt wether this index would be used
>for accessing parent table.
I was pointed to a section in the Oracle references. It stated that an index is necessary to avoid (share) locking of the parent table. The index seems to do nothing with performance issues besides the lock-prevention.
![]() |
![]() |