Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Do I need an Index?
If I have a table that is defined as:
CREATE TABLE ORGS
(
NUM INTEGER NOT NULL, ID INTEGER NOT NULL
and both "num" and "id" REFERENCES other tables to make sure theie data exist there before being in this table defined like:
ALTER TABLE ORGS
ADD CONSTRAINT XFK_NUM FOREIGN KEY (NUM)
REFERENCES NUM_TABLE(NUM) ON DELETE CASCADE
ALTER TABLE ORGS
ADD CONSTRAINT XFK_ID FOREIGN KEY (ID)
REFERENCES ID_TABLE(ID)
So, the data in ORGS would look something like:
1,99 1,98 1,97 2,99
So, my question: If I am using a query to pull data using the ID, i.e. 98, or 97 would an index speed up the processing or is there an inate index by virtue of there being a reference there?
Any comments appreciated.
Mike Received on Wed Aug 10 2005 - 10:44:53 CDT
![]() |
![]() |