Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: [Q] Foreign keys and indexes
On Mon, 26 Jan 1998 16:54:12 GMT, martinj(replace this with @)xs4all.nl (Martin Jesterhoudt) wrote:
>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.
>
Just because you create an index does not necessarily mean that it will or should be used. If further elaboration is needed please ask. Received on Tue Jan 27 1998 - 00:00:00 CST
![]() |
![]() |