Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report