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

前端 未结 5 1984
没有蜡笔的小新
没有蜡笔的小新 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:22

    Memory 101: Smaller stuff means holding more in RAM at once and thus fewer hard disk reads. If the DB is big enough and you're running certain kinds of queries, this could be a very serious factor. But it probably won't make big difference.

提交回复
热议问题