SQL Server如何压缩NULL位数据类型? [重复]

时间:2021-07-13 08:15:05

Possible Duplicate:
Can Microsoft store three-valued fields in a single bit?

可能重复:Microsoft可以将三值字段存储在一个位中吗?

According to the documentation for bit, the bit datatype can have three values, 0, 1 and NULL and if there are 8 or less bit columns in a table, those columns will be compressed into one byte.

根据bit的文档,bit数据类型可以有三个值,0,1和NULL,如果表中有8个或更少的位列,那些列将被压缩为一个字节。

These two behaviors seem contradictory. If so, which part is correct, the ability of a bit to be NULL or the compression of 8 bits to a byte?

这两种行为似乎是矛盾的。如果是这样,哪一部分是正确的,是一个位为NULL还是压缩8位到一个字节的能力?

1 个解决方案

#1


2  

NULL values are handled by a separate bit for each column (for example look here for details).

NULL值由每列的单独位处理(例如,请查看此处了解详细信息)。

#1


2  

NULL values are handled by a separate bit for each column (for example look here for details).

NULL值由每列的单独位处理(例如,请查看此处了解详细信息)。