In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
What to do when cross the line appears in SQL SERVER? for this question, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
SQL SERVER has always appeared as a "sheep" in the database, which is not as noble as ORACLE, not as sharp as POSTGRESQL, and not as popular as MYSQL. But many people's first enlightened database is SQL SERVER. SQL SERVER uses a wide area, but with such a good-natured database, if you cross the line, don't blame him for giving you a "stomach".
Let's take a look at the following example and then talk about how it offended the "little sheep."
First of all, we don't care about the table structure of this table. The main thing is that id is the primary key.
Then the query plan of our above picture is very normal, take the main key.
The crux of the question is why a simple primary key query turns into a full table scan.
Implicit conversion in SQL Server
(there is nothing special about the table, except that it uses char as the primary key.)
Let's talk about the problem of hermit conversion. First of all, it is clear that there are two aspects of hermit conversion.
1 the given value has no type, you want SQL SERVER to guess for you, and then guess wrong
2 given the type, but no, it is not the field type that you correspond to the table, it belongs to the case where the X lip is not opposite to the X mouth.
The final result of these two cases, continue to use the above example, that is, a good = becomes >
< 的操作 而反观正常的方式 当然问题已经说的很清楚了,解决也很简单,如果要在挖一下,SQL SERVER 的隐士转换也是有顺序的,下面就是顺序,1 用户定义,你的定义是第一位的,然后就开始以此类推的进行 "猜猜看" 的好戏了。Here is a table that can FROM TO the type (or guess) to an explicit tabular SHOW.
Of course, if there is a voice saying, how do I know if there is a hermit conversion or a lot of stored procedures in the program they write, how do I know the hermit conversion? is there any way to find out these "harmful spirits"? Of course, there is a way, directly open your extent event plan_affecting_convert, you can open the demon mirror, catch them one by one.
So when we operate the database, no matter what type of field you define, declare, or in the program, you'd better "match" him, otherwise the horns of "Little Sheep" will not feel good.
This is the answer to the question about what to do with cross the line in SQL SERVER. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
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.