In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.