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 -> Re: Do I need an Index?

Re: Do I need an Index?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 10 Aug 2005 19:06:34 +0200
Message-ID: <3vckf1hv5kue1fpn0up263nf0997s5l1pk@4ax.com>


On 10 Aug 2005 08:44:53 -0700, "mike" <hillmw_at_charter.net> wrote:

>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

There is no inate index and the id column needs to be indexed at least pre 9i.

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed Aug 10 2005 - 12:06:34 CDT

Original text of this message

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