Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Do I need an Index?
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 DBAReceived on Wed Aug 10 2005 - 12:06:34 CDT
![]() |
![]() |