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 |
Dinky
Starting Member
37 Posts |
Posted - 2008-02-12 : 10:12:36
|
Design/Modeling Question: How bad/different can 2-3 tables join be with a string field (individual) as primary key versus having additional integer field (individual) as primary key. This table can have upto 100000 records.Please advice. |
|
CShaw
Yak Posting Veteran
65 Posts |
Posted - 2008-02-12 : 10:29:26
|
A join is going to work much better on an int then a string. How bad? You would have to run some tests to get some specific numbers.Chris Shawwww.SQLonCall.com |
 |
|
Dinky
Starting Member
37 Posts |
Posted - 2008-02-12 : 10:34:17
|
I though so that there will be lot of difference. I ran a test but String primary key worked actually better - that prompted me to post the topic here. Since both string and integer primary key will be managed by index which makes (?) the queries/joins behave same in both cases. |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-12 : 11:02:34
|
It much depends on how long the string is.A page can hold approx 8000 bytes (with 100% fill factor), which is about 2000 records per page to seek or scan later.If your string is 8 bytes, every page can only hold 1000 records which essentially makes the index twice the size. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
|
|