In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The editor will share with you what null refers to in mysql. I hope you will gain a lot after reading this article. Let's discuss it together.
In mysql, null stands for nothing, is an undefined value, takes up space, but cannot participate in any calculation, because null values participate in any calculation is empty. Null makes indexes, index statistics, and values more complex, and affects the judgment of the optimizer.
Null in mysql is really difficult to deal with, and often many experts have been cheated by it during sql optimization.
In MySQL, null is unknown and takes up space. Null makes indexes, index statistics, and values more complex, and affects the judgment of the optimizer.
Null values ('') do not take up space, and note that there are no spaces between null values.
When count () counts the number of records in a column, the NULL value used will be automatically ignored by the system, but the null value will be counted into it.
It is determined that null uses is null or is not null, but empty characters are processed using =''or''.
For the timestamp data type, if you insert a NULL value, the value that appears is the current system time. Insert a null value and you will see '0000-00-0000: 00Remo00'.
For tables that have already been created, the performance improvement from changing null to not null for ordinary columns is relatively small, so there is no need to specifically find and null to modify not null one by one during tuning.
For tables that have been created, if you plan to create an index on the column, change it to not null as much as possible, and use 0 or a special value or null value''.
In summary, the advantages outweigh the disadvantages by specifying all tables as not null and specifying default''or other default values.
After reading this article, I believe you have a certain understanding of what null means in mysql. 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.