17 #ifndef OMNISCI_QUERYHINT_H
18 #define OMNISCI_QUERYHINT_H
23 #include <boost/algorithm/string.hpp>
90 {
"watchdog_max_projected_rows_per_device",
101 : global_hint(global_hint), hint_name(hint_name){};
119 bool has_kv_type_options)
128 bool has_kv_type_options,
129 std::vector<std::string>& list_options)
139 bool has_kv_type_options,
140 std::unordered_map<std::string, std::string>& kv_options)
151 void setKVOptions(std::unordered_map<std::string, std::string>& kv_options) {
163 const std::unordered_map<std::string, std::string>&
getKVOptions()
const {
234 for (
int i = 0; i < num_hints; ++i) {
236 updated_query_hints.registered_hint.at(i) =
true;
237 switch (static_cast<QueryHint>(i)) {
239 updated_query_hints.cpu_mode =
true;
242 updated_query_hints.columnar_output =
true;
245 updated_query_hints.rowwise_output =
true;
251 updated_query_hints.cuda_grid_size_multiplier =
255 updated_query_hints.opt_cuda_grid_and_block_size =
true;
258 updated_query_hints.bbox_intersect_bucket_threshold =
262 updated_query_hints.bbox_intersect_max_size =
266 updated_query_hints.bbox_intersect_allow_gpu_build =
true;
269 updated_query_hints.bbox_intersect_no_cache =
true;
272 updated_query_hints.bbox_intersect_keys_per_bin =
276 updated_query_hints.keep_result = global_hints.
keep_result;
279 updated_query_hints.keep_table_function_result =
283 updated_query_hints.aggregate_tree_fanout =
288 updated_query_hints.watchdog = global_hints.
watchdog;
299 updated_query_hints.use_loop_join = global_hints.
use_loop_join;
302 updated_query_hints.loop_join_inner_table_max_num_rows =
306 updated_query_hints.max_join_hash_table_size =
310 updated_query_hints.force_baseline_hash_join =
314 updated_query_hints.force_one_to_many_hash_join =
318 updated_query_hints.watchdog_max_projected_rows_per_device =
322 updated_query_hints.preflight_count_query_threshold =
329 updated_query_hints.ndv_groups_estimator_multiplier =
337 return updated_query_hints;
383 const auto lowered_hint_name = boost::algorithm::to_lower_copy(hint_name);
389 const auto identity = [](
const bool b) {
return b; };
394 const auto hint_class =
static_cast<int>(hint);
399 const auto hint_class =
static_cast<int>(hint);
405 using Hints = std::unordered_map<QueryHint, ExplainedQueryHint>;
407 #endif // OMNISCI_QUERYHINT_H
std::unordered_map< std::string, std::string > kv_options_
bool table_reordering_off
bool isGlobalHint() const
double bbox_intersect_keys_per_bin
const std::vector< int > & getInteritPath() const
const std::unordered_map< std::string, std::string > & getKVOptions() const
size_t g_preflight_count_query_threshold
double g_bbox_intersect_target_entries_per_bin
void setListOptions(std::vector< std::string > &list_options)
std::optional< bool > dynamic_watchdog
double cuda_grid_size_multiplier
ExplainedQueryHint(QueryHint hint, bool global_hint, bool is_marker, bool has_kv_type_options)
std::vector< bool > registered_hint
void setKVOptions(std::unordered_map< std::string, std::string > &kv_options)
unsigned g_trivial_loop_join_threshold
ExplainedQueryHint(QueryHint hint, bool global_hint, bool is_marker, bool has_kv_type_options, std::vector< std::string > &list_options)
size_t max_join_hash_table_size
bool opt_cuda_grid_and_block_size
bool hasKvOptions() const
bool keep_table_function_result
static const std::unordered_map< std::string, QueryHint > SupportedQueryHints
static QueryHint translateQueryHint(const std::string &hint_name)
std::vector< std::string > list_options_
double bbox_intersect_bucket_threshold
double ndv_groups_estimator_multiplier
void registerHint(const QueryHint hint)
size_t g_watchdog_max_projected_rows_per_device
HintIdentifier(bool global_hint, const std::string &hint_name)
size_t watchdog_max_projected_rows_per_device
std::optional< bool > watchdog
size_t preflight_count_query_threshold
static RegisteredQueryHint defaults()
bool isHintRegistered(const QueryHint hint) const
std::unordered_map< QueryHint, ExplainedQueryHint > Hints
size_t bbox_intersect_max_size
bool force_baseline_hash_join
bool bbox_intersect_no_cache
std::optional< bool > use_loop_join
RegisteredQueryHint operator||(const RegisteredQueryHint &global_hints) const
bool g_enable_watchdog false
size_t loop_join_inner_table_max_num_rows
bool bbox_intersect_allow_gpu_build
std::vector< int > inherit_paths_
bool has_kv_type_options_
bool any_of(std::vector< Analyzer::Expr * > const &target_exprs)
size_t aggregate_tree_fanout
const QueryHint getHint() const
const std::vector< std::string > & getListOptions() const
void setInheritPaths(std::vector< int > &interit_paths)
ExplainedQueryHint(QueryHint hint, bool global_hint, bool is_marker, bool has_kv_type_options, std::unordered_map< std::string, std::string > &kv_options)
bool isAnyQueryHintDelivered() const
bool force_one_to_many_hash_join
size_t g_bbox_intersect_max_table_size_bytes