NULL in MySQL (Performance & Storage)

后端 未结 4 833
北荒
北荒 2020-11-22 12:31

What exactly does null do performance and storage (space) wise in MySQL?

For example:

TINYINT: 1 Byte TINYINT w/NULL 1 byte + somehow stores NULL?

4条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 12:43

    dev.mysql.com/doc/refman/5.0/en/is-null-optimization.html

    MySQL can perform the same optimization on col_name IS NULL that it can use for col_name = constant_value. For example, MySQL can use indexes and ranges to search for NULL with IS NULL

提交回复
热议问题