Skip to content

Commit

Permalink
feat(shannon): selective-offload-est-query-cost
Browse files Browse the repository at this point in the history
  • Loading branch information
ShannonBase committed Dec 29, 2024
1 parent 97e760b commit ad8d673
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions storage/rapid_engine/handler/ha_shannon_rapid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,7 @@ static bool RapidPrepareEstimateQueryCosts(THD *thd, LEX *lex) {
if (thd->variables.use_secondary_engine == SECONDARY_ENGINE_OFF) {
SetSecondaryEngineOffloadFailedReason(thd, "use_secondary_engine set to off.");
return true;
}

else if (thd->variables.use_secondary_engine == SECONDARY_ENGINE_FORCED)
} else if (thd->variables.use_secondary_engine == SECONDARY_ENGINE_FORCED)
return false;

// gets the shannon statement context from thd, which stores in SecondaryEnginePrePrepareHook.
Expand All @@ -599,6 +597,7 @@ static bool RapidPrepareEstimateQueryCosts(THD *thd, LEX *lex) {
}

// 3: checks dict encoding projection, and varlen project size, etc.
if (ShannonBase::Utils::Util::check_dict_encoding_projection(thd)) return true;

return false;
}
Expand Down
4 changes: 4 additions & 0 deletions storage/rapid_engine/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,5 +311,9 @@ bool Util::dynamic_feature_normalization(THD *thd) {
return false;
}

// check whether the dictionary encoding projection is supported or not.
// returns true if supported to innodb, otherwise, false to secondary engine.
bool Util::check_dict_encoding_projection(THD *thd) { return false; }

} // namespace Utils
} // namespace ShannonBase
2 changes: 2 additions & 0 deletions storage/rapid_engine/utils/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class Util {
static bool decision_tree_classifier(THD *thd);

static bool dynamic_feature_normalization(THD *thd);

static bool check_dict_encoding_projection(THD *thd);
};

} // namespace Utils
Expand Down

0 comments on commit ad8d673

Please sign in to comment.