Using Plan Variants to Optimize Parameterized Queries

Objective

After completing this lesson, you will be able to analyze the impact of 'Plan Variant' on performance fluctuations due to parameter value changes and data skews during executions.

Content

Lesson Summary

  • Explain how Plan Variants address performance fluctuations in parameterized queries caused by variable data distributions.
  • Describe the limitations of caching only one execution plan for parameterized queries and how this can lead to suboptimal performance.
  • Outline how Plan Variants enable SAP HANA to cache multiple plans for parameterized queries based on the selectivity of table filters.
  • Summarize the cluster creation process in Plan Variants, including how the optimizer evaluates predicates, compiles plans, and associates filter values.
  • Utilize the M_SQL_PLAN_VARIANTS and M_SQL_PLAN_VARIANT_STATISTICS monitoring views to monitor active Plan Variants and view corresponding execution statistics.
  • Recognize the performance improvements achieved with Plan Variants, including reduced performance fluctuations and ensured stable query performance.