Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the difference in storage performance of null & # 039; & # 039; under Innodb

Shulou Source: shulou.com Published: 2022-05-31 15:37:37 10月24日 Update

Editor to share with you what is the difference in the storage performance of null'''under Innodb. I hope you will gain something after reading this article. Let's discuss it together.

Null: differences in nullbits bitmaps.

Variable byte: one more byte.

'': the variable byte is one more byte and the actual data area is one more byte for 0X20.

The statement is as follows:

Mysql > show create table testnull1\ gateway * 1. Row * * Table: testnull1Create Table: CREATE TABLE `testnull1` (`id` int (11) DEFAULT NULL, `name` varchar (20) DEFAULT NULL, `name1` varchar (10) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin11 row in set (0.00 sec) mysql > insert into testnull1 values Query OK, 1 row affected (0.22 sec) mysql > insert into testnull1 values; Query OK, 1 row affected (0.22 sec) mysql > insert into testnull1 values; Query OK, 1 row affected (0.22 sec) mysql > insert into testnull1 values; Query OK, 1 row affected (0.22 sec) mysql > select * from testnull1 +-+ | id | name | name1 | 1 | gaopeng | gaopeng | | 1 | gaopeng | | 1 | NULL | gaopeng | | 1 | | gaopeng | + -+ 4 rows in set (0.00 sec)

The main observation is line 2, line 3 and line 4.

The second line:

07 00:2 byte variable field length, the second 00 represents the length of the name field, where the''length is 0

00: null bitmap

0000180025:fixed extrasize

0000012065100000000ec9e9b1000014210110:rowid+trx_id+rollback_ptr

80000001: data 1

67616f70656e67: data 'gaopeng'

The third line

07:1 byte variable length

02:null bitmap

0000200026:fixed extrasize

0000012065110000000ec9eeb4000014060110:rowid+trx_id+rollback_ptr

80000001: data 1

67616f70656e67: data 'gaopeng'

Fourth line

0701 2-byte variable length, 01 represents the name field length

00:null bitmap

000028ff78:fixed extrasize

0000012065120000000ec9f0b6000014040110:rowid+trx_id+rollback_ptr

80000001: data 1

20: data''

67616f70656e67: data 'gaopeng'

After reading this article, I believe you have a certain understanding of "what is the difference in the storage performance of null''under Innodb". If you want to know more about it, welcome to follow the industry information channel, thank you for your reading!

Tags: Byte data length variable bitmap field different storage representative article region finished actual more knowledge industry sentence information information channel channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Information OPPO Reno NVidia Huawei