Add query hint: enable_rich_vector_format

This commit is contained in:
Zach41
2024-01-18 14:12:30 +00:00
committed by ob-robot
parent 5753203c06
commit 718c71384c
9 changed files with 116 additions and 6 deletions

View File

@ -2312,7 +2312,17 @@ OB_INLINE int ObPlanCache::construct_plan_cache_key(ObSQLSessionInfo &session,
pc_key.namespace_ = ns;
pc_key.sys_vars_str_ = session.get_sys_var_in_pc_str();
pc_key.config_str_ = session.get_config_in_pc_str();
pc_key.use_rich_vector_format_ = session.use_rich_format();
// here we use `initial_use_rich_format` instead of `use_rich_format` as part of key
// consider scenario of binding outline:
// ```
// set _enable_rich_vector_format = true;
// create outline xx on select /*+opt_param('enable_rich_vector_format', 'false')*/ * from t on select * from t;
// select * from t;
// ```
// rich_format is forced off by hint, thus `use_rich_format() = false`, `initial_use_rich_format() = true`
// added plan's key will be `true + other_info`, same as key constructed for getting plan.
// if `use_rich_format()` is used as part of key, added plan's key will be `false + other_info`.
pc_key.use_rich_vector_format_ = session.initial_use_rich_format();
pc_key.is_weak_read_ = is_weak;
return ret;
}