Roy - This could be a good IOT candidate, but I haven't used them myself. My
suggestion would be to test it. Here is a good paper on how to decide:
http://www.peled.com/white_papers/iot.pdf
A more recent edition is available on http://www.orapub.com (free but must
register)

Dennis Williams
DBA, 80%OCP, 100% DBA
Lifetouch, Inc.
[EMAIL PROTECTED] 

-----Original Message-----
Sent: Wednesday, May 28, 2003 11:45 AM
To: Multiple recipients of list ORACLE-L


Greetings all,

Say I have two main tables in a M:M relationship, and a junction table
resolving the relationship, like so:

create table staff
   (staff_id number PRIMARY KEY
   , name varchar2(50)
   , <<other cols>>) ;

create table projects
   (proj_id number PRIMARY KEY
   , name varchar2(50)
   , mgr_id number
   , <<other cols>>) ;

create table staff_projects
   (staff_id number
   , proj_id number
   , CONSTRAINT staff_projects_pk 
     PRIMARY KEY (staff_id, proj_id)
   , FOREIGN KEY (staff_id) REFERENCES staff(staff_id)
   , FOREIGN KEY (proj_id) REFERENCES projects(proj_id)
   ) ;

Queries that join staff_projects to projects to pull project info for a
given staff_id should be really fast, since staff_id is the leading column
in the index created to enforce the PK on staff_projects (right?)--and in
fact, the staff_projects table itself shouldn't need to be touched, since
all the needed info is in this index (also right?).

If I want to speed lookups of staff info for a given proj_id, I can create
another unique index on staff_projects(proj_id, staff_id).  There again, the
staff_projects table shouldn't need to be touched, b/c all the info is in
the index.

At this point, it seems like the table is sort of superflous--all the info
in it is better accessible in the two indexes.  If that's right--is there an
advantage in making staff_projects an index organized table?

Thanks!

-Roy

Roy Pardee
Programmer/Analyst/DBA
SWFPAC Lockheed Martin IT
Extension 8487
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Pardee, Roy E
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: DENNIS WILLIAMS
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to