In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Preface
I happened to encounter this knowledge point when I was preparing for the exam recently. I think the difference between char and varchar2 can be distinguished from the three criteria (space complexity, time complexity, stability) of the evaluation algorithm, just mark.
Identical point
Both char and varchar2 are used to store characters.
Differences
Memory consumption
Char is fixed-length character data, the length is in bytes, the minimum and default length is 1, and the maximum length is 2000. Varchar2 is character data with varying length, with a minimum length of 1 and a maximum length of 4000. The length of the varchar2 depends on the length of the stored string, the char is a fixed length, and the excess is filled with spaces. Varchar2 saves more space than char.
Efficiency
When using varchar2, Oracle needs parsing to analyze how many characters there are in this field, so a little slower char is a little more efficient than varchar2 (space for time)
Stability.
If a varchar2 column is often modified, and the length of the data to be modified each time is different, it will cause "row migration" phenomenon, resulting in redundant IUnio, which should be avoided when designing the database. In this case, it would be better to use char instead of varchar2. Hit the point.
When the field we query uses fixed-length character data, we need to pay attention to the format. The string length of the query needs to be equal to the length of the data type, otherwise the data cannot be found.
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.