Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    4

    Question Unanswered: compound primary key

    My oracle table has compound primary key of three columns.
    The table was created with CREATE TABLE ..... PRIMARY KEY( field1, field2, field3).... . What will be different if I create table with CREATE TABLE ..........PRIMARY KEY (field2,field3,field1).
    Thanks.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: compound primary key

    Originally posted by VSOLARSKI
    My oracle table has compound primary key of three columns.
    The table was created with CREATE TABLE ..... PRIMARY KEY( field1, field2, field3).... . What will be different if I create table with CREATE TABLE ..........PRIMARY KEY (field2,field3,field1).
    Thanks.
    No logical difference, but the index supporting the primary key will have its columns in the new order. That may make a difference to the performance of certain queries (some for the better, some for the worse).
    Also any foreign keys from other tables to this one would need their foreign key constraints changed to match.

Posting Permissions

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