17 #ifndef OMNISCI_QUERYHINT_H
18 #define OMNISCI_QUERYHINT_H
23 #include <boost/algorithm/string.hpp>
88 {
"watchdog_max_projected_rows_per_device",
97 : global_hint(global_hint), hint_name(hint_name){};
115 bool has_kv_type_options)
124 bool has_kv_type_options,
125 std::vector<std::string>& list_options)
135 bool has_kv_type_options,
136 std::unordered_map<std::string, std::string>& kv_options)
147 void setKVOptions(std::unordered_map<std::string, std::string>& kv_options) {
159 const std::unordered_map<std::string, std::string>&
getKVOptions()
const {
228 for (
int i = 0; i < num_hints; ++i) {
230 updated_query_hints.registered_hint.at(i) =
true;
231 switch (static_cast<QueryHint>(i)) {
233 updated_query_hints.cpu_mode =
true;
236 updated_query_hints.columnar_output =
true;
239 updated_query_hints.rowwise_output =
true;
245 updated_query_hints.cuda_grid_size_multiplier =
249 updated_query_hints.opt_cuda_grid_and_block_size =
true;
252 updated_query_hints.bbox_intersect_bucket_threshold =
256 updated_query_hints.bbox_intersect_max_size =
260 updated_query_hints.bbox_intersect_allow_gpu_build =
true;
263 updated_query_hints.bbox_intersect_no_cache =
true;
266 updated_query_hints.bbox_intersect_keys_per_bin =
270 updated_query_hints.keep_result = global_hints.
keep_result;
273 updated_query_hints.keep_table_function_result =
277 updated_query_hints.aggregate_tree_fanout =
282 updated_query_hints.watchdog = global_hints.
watchdog;
293 updated_query_hints.use_loop_join = global_hints.
use_loop_join;
296 updated_query_hints.loop_join_inner_table_max_num_rows =
300 updated_query_hints.max_join_hash_table_size =
304 updated_query_hints.force_baseline_hash_join =
308 updated_query_hints.force_one_to_many_hash_join =
312 updated_query_hints.watchdog_max_projected_rows_per_device =
316 updated_query_hints.preflight_count_query_threshold =
324 return updated_query_hints;
368 const auto lowered_hint_name = boost::algorithm::to_lower_copy(hint_name);
374 const auto identity = [](
const bool b) {
return b; };
379 const auto hint_class =
static_cast<int>(hint);
384 const auto hint_class =
static_cast<int>(hint);
390 using Hints = std::unordered_map<QueryHint, ExplainedQueryHint>;
392 #endif // OMNISCI_QUERYHINT_H
std::unordered_map< std::string, std::string > kv_options_
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
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