July 28, 2012 at 12:35 pm
Comments posted to this topic are about the item Primary Keys
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
July 28, 2012 at 12:39 pm
Nice easy unambiguous question.
A restful finish to to the week (for some), and a pleasant start to the week for others.
Published a little before its time, I guess, as it's the day after tomorrow's question. π
Tom
July 29, 2012 at 6:47 am
L' Eomot InversΓ© (7/28/2012)
Nice easy unambiguous question.A restful finish to to the week (for some), and a pleasant start to the week for others.
Published a little before its time, I guess, as it's the day after tomorrow's question. π
Nah just right if you use that unsupported command DBCC TIMEWARP
July 29, 2012 at 10:55 pm
Index has the limitation of 16 key columns, primary key can be either clustered or non-clustered. So it can also have only 16 columns. I guessed the answer as above.
π
July 30, 2012 at 12:05 am
Tom, Bitbucket and Rals - Thanks for dropping by and giving it a shot.
I believe that the limitation on columns participating in an INDEX is the same as for the primary key, so you were right to guess that Rals.
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
July 30, 2012 at 12:07 am
Easy one for Monday, thanks!
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
July 30, 2012 at 1:41 am
Than you for the good week start.........!!!
July 30, 2012 at 2:48 am
Got it wrong as there's no mention of a limit in the Primary Key or Create Table sections of BOL.
Anyone who even approaches the limit should be sent on a training course anyway π
July 30, 2012 at 4:28 am
I was pretty sure of the answer but went to check just to be absolutely sure because I've never gotten close to the limit. It just absolutely fascinates me that this little bit of very important "trivia" ISN'T covered under the constraints, primary key, or CREATE TABLE sections of BOL.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 30, 2012 at 5:24 am
This was removed by the editor as SPAM
July 30, 2012 at 5:40 am
Jeff Moden (7/30/2012)
I was pretty sure of the answer but went to check just to be absolutely sure because I've never gotten close to the limit. It just absolutely fascinates me that this little bit of very important "trivia" ISN'T covered under the constraints, primary key, or CREATE TABLE sections of BOL.
Same reaction, both to the question and BOL. Also, wasn't there a recent question that was tangentially related to this? Something about large data types in an index?
[font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
Connect to me on LinkedIn
July 30, 2012 at 6:43 am
Great question. Had to use MSDN to confirm my answer but will never forget it now.
July 30, 2012 at 7:04 am
+1
Cheers,
Steve
July 30, 2012 at 7:13 am
Thanks for the question!
This page shows the limit for primary key columns:
July 30, 2012 at 8:20 am
Viewing 15 posts - 1 through 15 (of 27 total)
You must be logged in to reply to this topic. Login to reply