Is it worth the trouble to use tinyint instead of int for SqlServer lookup tables?

前端 未结 5 1936
没有蜡笔的小新
没有蜡笔的小新 2021-02-02 11:56

When designing a lookup table (enum) in SqlServer 2005, if you know the number of entries will never get very high, should you use tinyint instead of int? I\'m most concerned a

5条回答
  •  无人及你
    2021-02-02 12:28

    I doubt that using smallint instead of int is going to have much performance benefit except in rare edge cases. You can easily build a test app for this though, create some test tables and do a million inserts/updates/selects and compare performance.

提交回复
热议问题