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 |
|
monaya
Yak Posting Veteran
58 Posts |
Posted - 2009-09-27 : 23:39:33
|
| Is there any serious difference in speed in terms of querying a table by a unique primary key integer column or varchar column that has no duplicate textual entries. |
|
|
smarty
Starting Member
13 Posts |
Posted - 2009-09-28 : 03:07:08
|
| Depends on how many records you have in the table. But in short, yes there is a serious difference in speed (use INT always)-----------------------------------Free SQL server monitoring for DBA'swww.realsmartsoftware.co.uk |
 |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2009-09-28 : 03:25:01
|
Int is a very index friendly, however there are many scenerio's when it is not the right choice when using a primary key. The statement of "use int always", is not necessarly rrue. Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-09-28 : 03:30:55
|
A fixed size datatype is generally faster to search than a variable size datatype.A smaller size datatype is generally faster to searach than a larger size datatype. N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|
|