SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 TSQL Question
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tooba
Posting Yak Master

149 Posts

Posted - 07/16/2014 :  00:04:08  Show Profile  Reply with Quote
Quick question,

I have TableA

ID, CASEID,AccountNumber,Fname,Lname,City

This table has Millions of rows, any my ID is a Primary Key (Clustered Index)

Now I am thinking to change Primary Key to (ID,CASEID,AccountNumber). I have two question here

1) After I change Primary Key, it could possible any performance issue?
2) This table has haviely Insert and Update, is it will effect?

Thank You.

SwePeso
Patron Saint of Lost Yaks

Sweden
30178 Posts

Posted - 07/16/2014 :  04:04:07  Show Profile  Visit SwePeso's Homepage  Reply with Quote
The primary key is just a constraint. It will somewhat affect performance because SQL Server will need to enforce the contraint.
The clustered key is still ID column?


Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

tooba111
Starting Member

USA
16 Posts

Posted - 07/16/2014 :  12:13:00  Show Profile  Reply with Quote
Before it was just ID, Now i am thinking to use Composite key (ID,CASEID,AccountNumber) as a Primary Key (Clustered Index).

and my question is above post...

Please let me know, if my ans/question is still not clear.

Thank You.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30178 Posts

Posted - 07/16/2014 :  14:19:02  Show Profile  Visit SwePeso's Homepage  Reply with Quote
You are going to change the clustered key too?



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 07/16/2014 :  16:43:55  Show Profile  Reply with Quote
quote:
Originally posted by SwePeso

You are going to change the clustered key too?

Apparently that is the plan.

quote:
Originally posted by tooba111

Before it was just ID, Now i am thinking to use Composite key (ID,CASEID,AccountNumber) as a Primary Key (Clustered Index).

Go to Top of Page

tooba111
Starting Member

USA
16 Posts

Posted - 07/17/2014 :  12:41:52  Show Profile  Reply with Quote
Yes.
Go to Top of Page

Bustaz Kool
Flowing Fount of Yak Knowledge

USA
1673 Posts

Posted - 07/17/2014 :  19:25:01  Show Profile  Reply with Quote
By making your clustered key wider, you will be impacting your indexing performance. How much this will be noticeable will need to be determined: Guess and Test.



Too often we enjoy the comfort of opinion without the discomfort of thought. - John F. Kennedy
Go to Top of Page

tooba
Posting Yak Master

149 Posts

Posted - 07/18/2014 :  01:12:07  Show Profile  Reply with Quote
Thank You for your reply, Would You mind if I ask Why it will effect performance issue?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000