sql执行组件是灰色的
In the previous articles of this series, SQL Server Execution Plans overview and SQL Server Execution Plans types we went through the different stages that the submitted SQL Server query followed and how it processed by the SQL Server Relational Engine that generates the Execution Plan and the SQL Server Storage Engine that performs the requested data retrieval or modification operation. In addition, we described deeply the different types and formats of the SQL Server Execution Plans that can be used for queries performance troubleshooting purposes. In this article, we will discuss the graphical query plan components and how to analyze it.
在本系列的前几篇文章中, SQL Server执行计划概述和SQL Server执行计划类型我们经历了提交SQL Server查询所遵循的不同阶段,以及由生成执行计划和SQLSQL Server关系引擎如何对其进行处理服务器存储引擎,执行请求的数据检索或修改操作。 此外,我们深入描述了可用于查询性能故障排除目的SQL Server执行计划的不同类型和格式。 在本文中,我们将讨论图形查询计划组件以及如何对其进行分析。
The SQL Execution Plan is used widely in tuning the performance of the queries by monitoring and troubleshooting how the query executed internally. To be able to take benefits of the SQL execution plan, we need to understand the different information provided by the SQL execution plan, clear at the surface or hidden between the operators. Recall that you should be grated SHOWPLAN permission in order to generate the Execution Plan. Members of the SYSADMIN, DBCREATOR or DB_OWNER will be able to generate the Execution Plans without the need for any extra permissions.
通过监视和解决内部查询的执行方式并对其进行故障排除,SQL执行计划被广泛用于调整查询的性能。 为了能够利用SQL执行计划,我们需要了解SQL执行计划提供的不同信息,这些信息在表面清晰可见,或者在操作员之间隐藏。 回想一下,您应该被授予SHOWPLAN权限才能生成执行计划。 SYSADMIN,DBCREATOR或DB_OWNER的成员将能够生成执行计划,而无需任何其他权限。
Let us start with a simple SQL Execution Plan. The below SQL Execution Plan is an Actual Plan generated after executing a simple SELECT statement. You may ask, how can I guess if it is an Actual Execution Plan or an Estimated Execution Plan. The answer is the Results tab that can be shown in the top of the figure, indicating that the query was executed before generating the Plan. If this part is removed from the plan, nothing can tell us from the first view what is the type of this graphical execution plan.
让我们从一个简单SQL执行计划开始。 下面SQL执行计划是在执行简单的SELECT语句后生成的实际计划。 您可能会问,我怎么能猜到它是实际执行计划还是估计执行计划。 答案是“结果”选项卡,该选项卡可以显示在图的顶部,指示该查询是在生成计划之前执行的。 如果将这部分从计划中删除,则从第一视图中什么也无法告诉我们该图形执行计划的类型。
The upper part of the SQL execution plan shows the cost of this query relative to the overall batch cost, in the case of generating the execution plan for multiple queries in the same session, as shown below:
在为同一会话中的多个查询生成执行计划的情况下,SQL执行计划的上部显示此查询相对于总批处理成本的查询成本,如下所示:
The statement of the submitted query will be also displayed at the top of the SQL execution plan. For long queries, as much of the query statement that can fit into the window will be displayed. You can get