Foreign Key with out index.
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Foreign Key with out index.

  1. #1
    Join Date
    Feb 2001
    Posts
    203
    Hi,
    I have 2 tables called CAL, Emp.
    Emp_id is primary key in emp table.
    Cal.Emp_id is foreign key.
    But i don't have index on cal.emp_id.

    I read the below statement id Doc:

    It is highly recommended that an index be created if the Foreign Key column is used in joining, or often used in a WHERE clause. Otherwise a table level lock will be placed on the parent table.

    How the above statement exatly effect on the database.
    user entering the data in cal table from web interface and doing commit imm. So give me some info on this. Thanks.
    sree

  2. #2
    Join Date
    Feb 2001
    Posts
    389
    U need to have a index on foreign key , if there are any transactions involving delete of the parent table based on
    primary key and u have delete cascade enabled.

  3. #3
    Join Date
    Feb 2001
    Posts
    203
    gpsingh,
    Thanks for your reply, Could you please give me one example
    sree

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width