Chapter I (2)--Prediction and actual implementation plan

Source: Internet
Author: User

As mentioned earlier, there are two different types of execution plans, the first is the output of the optimizer, which is the predictive execution plan, where the operators or steps are logical steps, because they represent the view of the execution plan in the optimizer, but do not represent the physical aspect of the actual execution.

Another plan is to represent the output that the query actually performs. This type is called the actual execution plan, which indicates what happens when the query is actually executed.

These two plans show separate sets of results, but they can be seen as having a huge resemblance. In most cases, the same operator for the same cost will appear in both execution plans. However, when a recompile occurs, SQL Server deletes the plan in the plan cache and rebuilds it, and there is a significant difference between the two. This situation usually occurs when the statistics change, or something else happens when the storage engine processes the query. We will explain in more detail in the later part of this chapter.

The estimated execution plan (hereafter referred to as the estimate plan) is a plan that is stored in the plan cache, so we can only execute plans that are generated when the query is run by the actual execution plan. The estimate plan never accesses data directly, but it is quite effective for large, complex, potentially long-running query analysis. But the actual plan is preferred because it shows a lot of important statistics in the running process, such as the number of rows actually accessed by a particular operator. Typically, this extra information makes the actual plan the most common way to do it, but estimating the scheduling machine is important, especially since you can get it from the plan cache.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.