add config _globle_enable_rich_vector_format
This commit is contained in:
		@ -1890,4 +1890,7 @@ DEF_STR_WITH_CHECKER(choose_migration_source_policy, OB_TENANT_PARAMETER, "idc",
 | 
			
		||||
DEF_BOOL(_enable_choose_migration_source_policy, OB_TENANT_PARAMETER, "True",
 | 
			
		||||
        "Control whether to use chose_migration_source_policy. "
 | 
			
		||||
        "If the value of configure is false, it will not use chose_migration_source_policy and choose replica with the largest checkpoint scn as the source.",
 | 
			
		||||
        ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
 | 
			
		||||
        ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
 | 
			
		||||
DEF_BOOL(_global_enable_rich_vector_format, OB_CLUSTER_PARAMETER, "True",
 | 
			
		||||
         "Control whether use rich vector format in vectorization engine",
 | 
			
		||||
         ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
 | 
			
		||||
 | 
			
		||||
@ -2323,6 +2323,7 @@ OB_INLINE int ObPlanCache::construct_plan_cache_key(ObSQLSessionInfo &session,
 | 
			
		||||
  // 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.config_use_rich_format_ = session.config_use_rich_format();
 | 
			
		||||
  pc_key.is_weak_read_ = is_weak;
 | 
			
		||||
  return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -166,7 +166,8 @@ struct ObPlanCacheKey : public ObILibCacheKey
 | 
			
		||||
    {
 | 
			
		||||
      uint16_t is_weak_read_ : 1;
 | 
			
		||||
      uint16_t use_rich_vector_format_ : 1;
 | 
			
		||||
      uint16_t reserved_ : 14; // reserved
 | 
			
		||||
      uint16_t config_use_rich_format_ : 1;
 | 
			
		||||
      uint16_t reserved_ : 13; // reserved
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@ -1250,17 +1250,21 @@ int ObResolver::resolve(IsPrepared if_prepared, const ParseNode &parse_tree, ObS
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (OB_SUCC(ret)) {
 | 
			
		||||
        bool has_rich_format_hint = false;
 | 
			
		||||
        bool enable_rich_format = false;
 | 
			
		||||
        ObOptParamHint &opt_hint = params_.query_ctx_->query_hint_.global_hint_.opt_params_;
 | 
			
		||||
        if (OB_FAIL(opt_hint.check_and_get_bool_opt_param(ObOptParamHint::ENABLE_RICH_VECTOR_FORMAT,
 | 
			
		||||
                                                          has_rich_format_hint,
 | 
			
		||||
                                                          enable_rich_format))) {
 | 
			
		||||
          LOG_WARN("check and get bool opt param failed", K(ret));
 | 
			
		||||
        } else if (has_rich_format_hint) {
 | 
			
		||||
          params_.session_info_->set_force_rich_format(
 | 
			
		||||
            enable_rich_format ? ObBasicSessionInfo::ForceRichFormatStatus::FORCE_ON :
 | 
			
		||||
                                 ObBasicSessionInfo::ForceRichFormatStatus::FORCE_OFF);
 | 
			
		||||
        if (params_.session_info_->is_force_off_rich_format()) {
 | 
			
		||||
          // do nothing
 | 
			
		||||
        } else {
 | 
			
		||||
          bool has_rich_format_hint = false;
 | 
			
		||||
          bool enable_rich_format = false;
 | 
			
		||||
          ObOptParamHint &opt_hint = params_.query_ctx_->query_hint_.global_hint_.opt_params_;
 | 
			
		||||
          if (OB_FAIL(opt_hint.check_and_get_bool_opt_param(ObOptParamHint::ENABLE_RICH_VECTOR_FORMAT,
 | 
			
		||||
                                                            has_rich_format_hint,
 | 
			
		||||
                                                            enable_rich_format))) {
 | 
			
		||||
            LOG_WARN("check and get bool opt param failed", K(ret));
 | 
			
		||||
          } else if (has_rich_format_hint) {
 | 
			
		||||
            params_.session_info_->set_force_rich_format(
 | 
			
		||||
              enable_rich_format ? ObBasicSessionInfo::ForceRichFormatStatus::FORCE_ON :
 | 
			
		||||
                                   ObBasicSessionInfo::ForceRichFormatStatus::FORCE_OFF);
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -157,7 +157,8 @@ ObBasicSessionInfo::ObBasicSessionInfo(const uint64_t tenant_id)
 | 
			
		||||
      is_client_sessid_support_(false),
 | 
			
		||||
      use_rich_vector_format_(false),
 | 
			
		||||
      last_refresh_schema_version_(OB_INVALID_VERSION),
 | 
			
		||||
      force_rich_vector_format_(ForceRichFormatStatus::Disable)
 | 
			
		||||
      force_rich_vector_format_(ForceRichFormatStatus::Disable),
 | 
			
		||||
      config_use_rich_format_(true)
 | 
			
		||||
{
 | 
			
		||||
  thread_data_.reset();
 | 
			
		||||
  MEMSET(sys_vars_, 0, sizeof(sys_vars_));
 | 
			
		||||
@ -461,6 +462,7 @@ void ObBasicSessionInfo::reset(bool skip_sys_var)
 | 
			
		||||
  client_identifier_.reset();
 | 
			
		||||
  last_refresh_schema_version_ = OB_INVALID_VERSION;
 | 
			
		||||
  proxy_user_id_ = OB_INVALID_ID;
 | 
			
		||||
  config_use_rich_format_ = true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ObBasicSessionInfo::reset_timezone()
 | 
			
		||||
 | 
			
		||||
@ -484,9 +484,18 @@ public:
 | 
			
		||||
                    const bool need_check_valid /* true */);
 | 
			
		||||
  void init_use_rich_format()
 | 
			
		||||
  {
 | 
			
		||||
    use_rich_vector_format_ = GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_4_3_0_0
 | 
			
		||||
                              && sys_vars_cache_.get_enable_rich_vector_format();
 | 
			
		||||
    force_rich_vector_format_ = ForceRichFormatStatus::Disable;
 | 
			
		||||
    config_use_rich_format_ = GCONF._global_enable_rich_vector_format;
 | 
			
		||||
    if (!config_use_rich_format_) {
 | 
			
		||||
      use_rich_vector_format_ = false;
 | 
			
		||||
      force_rich_vector_format_ = ForceRichFormatStatus::FORCE_OFF;
 | 
			
		||||
    } else {
 | 
			
		||||
      use_rich_vector_format_ = GET_MIN_CLUSTER_VERSION() >= CLUSTER_VERSION_4_3_0_0
 | 
			
		||||
                                && sys_vars_cache_.get_enable_rich_vector_format();
 | 
			
		||||
      force_rich_vector_format_ = ForceRichFormatStatus::Disable;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  bool is_force_off_rich_format() {
 | 
			
		||||
    return force_rich_vector_format_ == ForceRichFormatStatus::FORCE_OFF;
 | 
			
		||||
  }
 | 
			
		||||
  bool use_rich_format() const {
 | 
			
		||||
    if (force_rich_vector_format_ != ForceRichFormatStatus::Disable) {
 | 
			
		||||
@ -496,6 +505,8 @@ public:
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  bool config_use_rich_format() { return config_use_rich_format_; }
 | 
			
		||||
 | 
			
		||||
  bool initial_use_rich_format() const {
 | 
			
		||||
    return use_rich_vector_format_;
 | 
			
		||||
  }
 | 
			
		||||
@ -2342,6 +2353,8 @@ private:
 | 
			
		||||
  // force_rich_vector_format_ == FORCE_OFF => use_rich_format() returns false
 | 
			
		||||
  // otherwise use_rich_format() returns use_rich_vector_format_
 | 
			
		||||
  ForceRichFormatStatus force_rich_vector_format_;
 | 
			
		||||
  // just used to plan cache key
 | 
			
		||||
  bool config_use_rich_format_;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user