There are some argument in favor of GUID and its mainly to maintain uniqueness in merge replication scenario or data warehousing scenario where data will be migrated from multiple servers and having single identity (INT) column will cause duplication.
Why we should not use GUID ?
1.The key issues with GUID is its very large (16 bytes) and contain alpha-numerics.
2.The key issues with GUID is its very large (16 bytes) and contain alpha-numerics. GUID’s are mainly used as PRIMARY KEY (usally CLUSTERED) to ensure uniqueness of rows. As a rule of thumb clustered index key / primary key should be as narrow as possible (in case of primary key consider lookups for primary key column by foriegn key tables) and therefore GUID are not best suited for clustered index.
3.Again it will cause very high fragmentation and page split on data pages as well as index pages
4.client passes GUID value to be searched to database its always rendered as string and thats the last thing you want any database to do. Databases Engines are very special purpose applications and they are not very good in complicated arthmethics and string rendering and searching.
5.Optimizer always prefer to use index created on INT or numeric column as it is very easy to compare with the value (imagine comparing string with other string).
Subscribe to:
Post Comments (Atom)
2 comments:
Tеrrіfic pοst however , I was wοnԁering if уou could wrіtе
a litte mοrе on this topic? I'd be very thankful if you could elaborate a little bit further. Cheers!
Check out my homepage: www.biggreeneggguide.com
Also see my webpage :: buy a big green egg
Heya i'm for the primary time here. I found this board and I in finding It really helpful & it helped me out much. I am hoping to offer one thing again and aid others like you helped me.
My web blog :: Okc Roofer
Also see my site :: okc roofers
Post a Comment