eG Monitoring
 

Measures reported by HanaPlnCachTest

The SAP HANA database provides an object, the SQL plan cache, that stores plans generated from previous executions. The plan cache stores execution plans of frequently executed SQL statements so that they can be reused whenever the statement is run. Whenever the execution of a statement is requested, a SQL procedure checks the SQL plan cache to see if there is a plan already compiled. If a match is found, the cached plan is reused. If not, the statement is compiled and the generated plan is cached. SQL statements stay in the Plan Cache as long as they are required, but entries which are of little value are evicted from the cache. Evicted plans no longer appear in the SQL plan cache and thus cannot be reused, so a new plan needs to be created. Therefore, if expected cache hits are missing, it might be helpful to check whether the relevant plan has been invalidated or evicted.

As the SQL plan cache collects statistics on the preparation and execution of SQL statements, it is an important tool for understanding and analyzing SQL processing. For example, it can help you to find slow queries, as well as measure the resource utilization and overall performance of your system . Using this test, administrators can identify the number and size of evicted plans, size of cached plan, plan cache hit ratio, and average time between the plan cache insertion and eviction. This way, they can promptly detect and resolve any resource contention due to improper size of the cache.

Outputs of the test: One set of results for the target database server being monitored

The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
CachedPlanSize Indicates the total size of SQL Plan cache during the last measurement period. GB

 

EvictedPlans Indicates the number of evicted plans from SQL Plan cache during the last measurement period. Number

A low value is desired for this measure. If EVICTED_PLAN_COUNT is too high, it means SQL plan cache capacity is not enough and too many compilations occurs.

PlanCacheHitRatio Indicates the percentage of plans that are satisfied from the Plan Cache during the last measurement period. Percent

This measure indicates how much the plan cache is being used. A high percentage here means that your target server is not building a new plan for every query it is executing so is working effectively and efficiently. A low percentage here means that for some reason, the server is doing more work than it needs to.

EvictedPlanSize Indicates the accumulated total size of evicted plans during the last measurement period. GB

 

EvictedPlanAvgCacheTime Indicates the average duration between plan cache insertion and eviction during the last measurement period. Milliseconds