Saturday 8 February 2014

SQL SERVER – GUID vs INT

Let me start a list by suggesting one advantage and one disadvantage in each case.

INT

Advantage:
  1. Numeric values (and specifically integers) are better for performance when used in joins, indexes and conditions.
  2. Numeric values are easier to understand for application users if they are displayed.
Disadvantage:
  1. If your table is large, it is quite possible it will run out of it and after some numeric value there will be no additional identity to use.

GUID

Advantage:
  1. Unique across the server.
Disadvantage:
  1. String values are not as optimal as integer values for performance when used in joins, indexes and conditions.
  2. More storage space is required than INT.
Please note that I am looking to create list of all the generic comparisons. There can be special cases where the stated information is incorrect, feel free to comment on the same.

No comments:

Post a Comment