• Performance-wise, Int will be better than BigInt, and BigInt will be better than UniqueIdentifier. Less storage, less RAM, less I/O, etc., with the smaller datatypes.

    The reasons to use GUIDs over IDs are based on business rules, technical needs, and security, not on performance.

    As already mentioned, if you have an ID value (Int or BigInt) in a URL as a variable value (this is a very common situation), then someone can just change the value in the URL and get other data. Sometimes, data they shouldn't be allowed to have. Good luck doing that with a GUID in the URL. Can be done, but it's very, very labor-intensive and time consuming (even if automated). A good botnet could run through GUID permutations pretty rapidly, but it would show as a DDOS attack on your servers, and there are ways to deal with that.

    If you're dealing with multi-computer replication, like Merge Replication, then GUIDs are needed to insure no colisions between values. Int/BigInt won't do that very well, if at all.

    If you want to cut out a call to the DB server, you can generate GUIDs for new data in the application and pass them in as a parameter in the insert statement to a table, instead of inserting and then returning the value. Identity columns don't allow for that. On a busy system, this can actually make a difference in overall application performance.

    Those are real reasons to use GUIDs. Not "performance" in the database.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon