How much disk-space is needed to store a NULL value using postgresql DB?

前端 未结 3 1500
花落未央
花落未央 2020-11-30 06:43

let\'s say I have a column on my table defined the following:

\"MyColumn\" smallint NULL

Storing a value like 0, 1 or something else should

3条回答
  •  我在风中等你
    2020-11-30 06:47

    It should need 1 byte (0x00) however it's the structure of the table that makes up most of the space, adding this one value might change something (Like adding a row) which needs more space than the sum of the data in it.

    Edit: Laramie seems to know more about null than me :)

提交回复
热议问题