Performance feedback is one of the adaptive query optimizer features introduced in Oracle Database 12c. The aim of this short post isn’t to explain how it works, but to simply warn you about a buggy behavior in its configuration.
The parameters that control performance feedback in 12c are the following:
So far, so good.
The problem is that all those parameters control the undocumented parameter _OPTIMIZER_PERFORMANCE_FEEDBACK without checking how the others are set. As a result, knowing the value of the documented parameters isn’t enough to know whether statistics feedback is enabled. What you have to know is the order in which they were set! Alternatively you can check the value of the undocumented parameter.
To demonstrate that behavior I wrote this script. It’s output, when executed against 12.1 and 12.2, is the following. As you can see, when PARALLEL_DEGREE_POLICY is set after OPTIMIZER_ADAPTIVE_FEATURES/ OPTIMIZER_ADAPTIVE_STATISTICS, performance feedback is incorrectly enabled.
VERSION ------------------------------------------------------------------------------------ Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production WHAT ------------------------------------------------------------------------------------ Set optimizer_adaptive_features *before* parallel_degree_policy optimizer_adaptive_features parallel_degree_policy _optimizer_performance_feedback --------------------------- ---------------------- ------------------------------- FALSE MANUAL OFF FALSE LIMITED OFF FALSE AUTO OFF FALSE ADAPTIVE ALL TRUE MANUAL OFF TRUE LIMITED OFF TRUE AUTO OFF TRUE ADAPTIVE ALL WHAT ------------------------------------------------------------------------------------ Set optimizer_adaptive_features *after* parallel_degree_policy parallel_degree_policy optimizer_adaptive_features _optimizer_performance_feedback ---------------------- --------------------------- ------------------------------- MANUAL FALSE OFF LIMITED FALSE OFF AUTO FALSE OFF ADAPTIVE FALSE OFF MANUAL TRUE OFF LIMITED TRUE OFF AUTO TRUE OFF ADAPTIVE TRUE ALL
VERSION ------------------------------------------------------------------------------------ Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production WHAT ------------------------------------------------------------------------------------ Set optimizer_adaptive_statistics *before* parallel_degree_policy optimizer_adaptive_statistics parallel_degree_policy _optimizer_performance_feedback ----------------------------- ---------------------- ------------------------------- FALSE MANUAL OFF FALSE LIMITED OFF FALSE AUTO OFF FALSE ADAPTIVE ALL TRUE MANUAL OFF TRUE LIMITED OFF TRUE AUTO OFF TRUE ADAPTIVE ALL WHAT ------------------------------------------------------------------------------------ Set optimizer_adaptive_statistics *after* parallel_degree_policy parallel_degree_policy optimizer_adaptive_statistics _optimizer_performance_feedback ---------------------- ----------------------------- ------------------------------- MANUAL FALSE OFF LIMITED FALSE OFF AUTO FALSE OFF ADAPTIVE FALSE OFF MANUAL TRUE OFF LIMITED TRUE OFF AUTO TRUE OFF ADAPTIVE TRUE ALL
Update 2018-02-26: to fix this issue, as of version 18.1.0, the initialization parameter OPTIMIZER_ADAPTIVE_STATISTICS no longer controls performance feedback.
VERSION ------------------------------------------------------------------------------------ Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production WHAT ------------------------------------------------------------------------------------ Set optimizer_adaptive_statistics *before* parallel_degree_policy optimizer_adaptive_statistics parallel_degree_policy _optimizer_performance_feedback ----------------------------- ---------------------- ------------------------------- FALSE MANUAL OFF FALSE LIMITED OFF FALSE AUTO OFF FALSE ADAPTIVE ALL TRUE MANUAL OFF TRUE LIMITED OFF TRUE AUTO OFF TRUE ADAPTIVE ALL WHAT ------------------------------------------------------------------------------------ Set optimizer_adaptive_statistics *after* parallel_degree_policy parallel_degree_policy optimizer_adaptive_statistics _optimizer_performance_feedback ---------------------- ----------------------------- ------------------------------- MANUAL FALSE OFF LIMITED FALSE OFF AUTO FALSE OFF ADAPTIVE FALSE ALL MANUAL TRUE OFF LIMITED TRUE OFF AUTO TRUE OFF ADAPTIVE TRUE ALL
Recent comments
3 years 6 weeks ago
3 years 18 weeks ago
3 years 22 weeks ago
3 years 23 weeks ago
3 years 28 weeks ago
3 years 49 weeks ago
4 years 17 weeks ago
4 years 47 weeks ago
5 years 31 weeks ago
5 years 31 weeks ago