?
Solved

Are there any restrictions for number of columns in a composite primary key?

Posted on 2011-10-19
8
Medium Priority
?
201 Views
Last Modified: 2012-08-13
Are there any restrictions for number of columns in a composite primary key?
0
Comment
Question by:sakthikumar
  • 2
  • 2
  • 2
6 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1000 total points
ID: 36992033
In Oracle, a primary key can not contain more than 32 columns.
0
 
LVL 35

Assisted Solution

by:sarabande
sarabande earned 1000 total points
ID: 36992742
i strongly recommend not using more than 3 fields. if you need a fast query on the table better use only single primary-key (even when to build redundantely out of other fields using a before insert trigger).  i had a bad sample where they used 5 fields for key and created 10 (!) indexes to speed up the queries with no success.

Sara
0
 

Author Comment

by:sakthikumar
ID: 37011600
I just want to know the limit. anyway the information is useful.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 35

Expert Comment

by:sarabande
ID: 37011758
sakthikumar, i tried to help but don't want to get a c grade for a "useful" information. so please request attention from moderators and don't award any points to me.

Sara
0
 

Author Comment

by:sakthikumar
ID: 37013124
I want to know the maximum no. of columns can a composite primary key can have.? This is for preparing another design.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 37013779
well, the question was about restrictions ... which imply to be technical restrictions, hence my comment which is documented and correct.
the 2nd comment tells that in practice, a primary key should not be more than 3 (which would indeed imply some incorrect design).

I fail to see in how far this cannot be graded A, and my this time, my comment failed to be included in the point (split) ?  ...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to take different types of Oracle backups using RMAN.
Suggested Courses
Course of the Month7 days, 22 hours left to enroll

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question