Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Do I need an Index?

Do I need an Index?

From: mike <hillmw_at_charter.net>
Date: 10 Aug 2005 08:44:53 -0700
Message-ID: <1123688693.447751.251010@g49g2000cwa.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US