Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sql_msg
Starting Member
13 Posts |
Posted - 2014-08-15 : 19:43:55
|
Hi,I want to understand the why the partition key should be unique or a kind of primary key(but not necessarily). What is the exact reason,,anyreference or link that explains will be helpful.Regards,msg |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-08-16 : 06:58:05
|
SQL does not use a partition key but rather a partition function.http://msdn.microsoft.com/en-us/library/ms187802.aspx |
|
|
sql_msg
Starting Member
13 Posts |
Posted - 2014-08-18 : 14:56:34
|
Yes I agree we have to partition function but my concern was with the key we consider for the partition function should be unique/ or part of the primary key..its recommended. My question is why it is should be unique/ column best candidate for Clustered Index if Index is not there ?Hope this time the question is clear ? |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-08-18 : 15:28:38
|
The partition function can be anything at all. It can be related to the primary key if that makes sense but can be something else entirely. It's not so much that you choose one "key we consider for the partition function". You choose some column or combination of columns that makes sense for your business. One popular choice is a datetime column if it is set at insertion time to the current datetime (e.g. getdate()) Then your function can say "split on the year 2013", or something. |
|
|
|
|
|