eG Monitoring
 

Measures reported by MsSqlExpPlStTest

An execution plan in SQL Server is a simple graphical representation of the operations that the query optimizer generates to calculate the most efficient way to return a set of results. Once a query is executed, the query processing engine quickly generates multiple execution plans and selects the one which returns the results with the best performance. There are two types of execution plans to be specific:

  • Estimated Execution Plan - This type of execution plan is just a guess by the query processor about how the specific steps that are to be involved while returning the results. It is often generated before the query has been executed.

  • Actual Execution Plan - This plan is generated after the query has been executed. It shows the actual operations and steps involved while executing the query. This may or may not differ from the Estimated Execution Plan.

The query optimizer plays a key role in query processing and decides the most optimal explain plan for the queries that should be executed. The optimizer estimates the resource consumption cost of the explain plan candidates and chooses the effective and cheap plan in terms of I/O, memory, CPU, and time. In the process, the query optimizer also changes the plans during query processing as the underlying costs change. The explain change happens when any of the following happen on a running instance:

  • Re-run of dbms_stats for CBO statistics,

  • Alter table commands

  • Adding/dropping an index

  • Using dynamic sampling

  • Parallelism is enabled

Sometimes, query processing may be delayed when the explain plan decided by the SQL optimizer is used for execution. This may lead to query processing bottlenecks. To avoid such bottlenecks, it is necessary for the administrators to keep track on the explain plans that were changed during query execution. The MsSqlExpPlStTest helps administrators in this regard!

This test periodically monitors the target Microsoft SQL server and reports the number of times that the explain plans were changed during query execution. The detailed diagnosis reported by this test reveals the details on plan changes for each query, name of all the plans used for each query, etc.

Outputs of the test : One set of results for the Microsoft SQL Server that is being monitored

The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
explainPlanChanged Indicates the number of times the explain plans were changed during the last measurement period. Number The detailed diagnosis of this measure reveals the session ID, user name, database name, host name, count of unique plans, name of old and new explain plans and brief description about the query.
rateOfExplainPlanChange Indicates the rate at which explain plans were changed during the last measurement period. Plans/second