OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RegisteredQueryHint Struct Reference

#include <QueryHint.h>

Public Member Functions

 RegisteredQueryHint ()
 
RegisteredQueryHint operator|| (const RegisteredQueryHint &global_hints) const
 
bool isAnyQueryHintDelivered () const
 
void registerHint (const QueryHint hint)
 
bool isHintRegistered (const QueryHint hint) const
 

Static Public Member Functions

static RegisteredQueryHint defaults ()
 
static QueryHint translateQueryHint (const std::string &hint_name)
 

Public Attributes

bool cpu_mode
 
bool columnar_output
 
bool rowwise_output
 
bool keep_result
 
bool keep_table_function_result
 
std::optional< bool > watchdog
 
std::optional< bool > dynamic_watchdog
 
size_t query_time_limit
 
size_t watchdog_max_projected_rows_per_device
 
size_t preflight_count_query_threshold
 
size_t cuda_block_size
 
double cuda_grid_size_multiplier
 
bool opt_cuda_grid_and_block_size
 
size_t aggregate_tree_fanout
 
double bbox_intersect_bucket_threshold
 
size_t bbox_intersect_max_size
 
bool bbox_intersect_allow_gpu_build
 
bool bbox_intersect_no_cache
 
double bbox_intersect_keys_per_bin
 
std::optional< bool > use_loop_join
 
size_t loop_join_inner_table_max_num_rows
 
size_t max_join_hash_table_size
 
bool force_baseline_hash_join
 
bool force_one_to_many_hash_join
 
std::vector< bool > registered_hint
 

Detailed Description

Definition at line 186 of file QueryHint.h.

Constructor & Destructor Documentation

RegisteredQueryHint::RegisteredQueryHint ( )
inline

Definition at line 194 of file QueryHint.h.

Referenced by defaults().

195  : cpu_mode(false)
196  , columnar_output(false)
197  , rowwise_output(false)
198  , keep_result(false)
200  , watchdog(std::nullopt)
201  , dynamic_watchdog(std::nullopt)
202  , query_time_limit(0)
205  , cuda_block_size(0)
209  , bbox_intersect_bucket_threshold(std::numeric_limits<double>::max())
212  , bbox_intersect_no_cache(false)
214  , use_loop_join(std::nullopt)
216  , max_join_hash_table_size(std::numeric_limits<size_t>::max())
217  , force_baseline_hash_join(false)
double bbox_intersect_keys_per_bin
Definition: QueryHint.h:353
size_t g_preflight_count_query_threshold
Definition: Execute.cpp:84
double g_bbox_intersect_target_entries_per_bin
Definition: Execute.cpp:111
std::optional< bool > dynamic_watchdog
Definition: QueryHint.h:334
double cuda_grid_size_multiplier
Definition: QueryHint.h:341
size_t cuda_block_size
Definition: QueryHint.h:340
std::vector< bool > registered_hint
Definition: QueryHint.h:362
unsigned g_trivial_loop_join_threshold
Definition: Execute.cpp:92
size_t max_join_hash_table_size
Definition: QueryHint.h:358
bool opt_cuda_grid_and_block_size
Definition: QueryHint.h:342
bool keep_table_function_result
Definition: QueryHint.h:332
size_t query_time_limit
Definition: QueryHint.h:335
double bbox_intersect_bucket_threshold
Definition: QueryHint.h:348
size_t g_watchdog_max_projected_rows_per_device
Definition: Execute.cpp:83
size_t watchdog_max_projected_rows_per_device
Definition: QueryHint.h:336
std::optional< bool > watchdog
Definition: QueryHint.h:333
size_t preflight_count_query_threshold
Definition: QueryHint.h:337
size_t bbox_intersect_max_size
Definition: QueryHint.h:350
bool force_baseline_hash_join
Definition: QueryHint.h:359
bool bbox_intersect_no_cache
Definition: QueryHint.h:352
std::optional< bool > use_loop_join
Definition: QueryHint.h:356
size_t loop_join_inner_table_max_num_rows
Definition: QueryHint.h:357
bool bbox_intersect_allow_gpu_build
Definition: QueryHint.h:351
size_t aggregate_tree_fanout
Definition: QueryHint.h:345
bool force_one_to_many_hash_join
Definition: QueryHint.h:360
size_t g_bbox_intersect_max_table_size_bytes
Definition: Execute.cpp:110

+ Here is the caller graph for this function:

Member Function Documentation

static RegisteredQueryHint RegisteredQueryHint::defaults ( )
inlinestatic

Definition at line 364 of file QueryHint.h.

References RegisteredQueryHint().

Referenced by anonymous_namespace{RelAlgDag.cpp}::create_compound(), RelAlgExecutor::createAggregateWorkUnit(), RelAlgExecutor::createCompoundWorkUnit(), RelAlgExecutor::createFilterWorkUnit(), RelAlgExecutor::createProjectWorkUnit(), RelAlgExecutor::createUnionWorkUnit(), RelAlgExecutor::executeWorkUnit(), QueryRunner::QueryRunner::getParsedQueryHint(), and HashJoin::getSyntheticInstance().

364 { return RegisteredQueryHint(); }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool RegisteredQueryHint::isAnyQueryHintDelivered ( ) const
inline

Definition at line 373 of file QueryHint.h.

References anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of(), and registered_hint.

Referenced by RelAlgDag::getQueryHint().

373  {
374  const auto identity = [](const bool b) { return b; };
375  return std::any_of(registered_hint.begin(), registered_hint.end(), identity);
376  }
std::vector< bool > registered_hint
Definition: QueryHint.h:362
bool any_of(std::vector< Analyzer::Expr * > const &target_exprs)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool RegisteredQueryHint::isHintRegistered ( const QueryHint  hint) const
inline
RegisteredQueryHint RegisteredQueryHint::operator|| ( const RegisteredQueryHint global_hints) const
inline

Definition at line 221 of file QueryHint.h.

References aggregate_tree_fanout, bbox_intersect_bucket_threshold, bbox_intersect_keys_per_bin, bbox_intersect_max_size, CHECK_EQ, cuda_block_size, cuda_grid_size_multiplier, dynamic_watchdog, force_baseline_hash_join, force_one_to_many_hash_join, kAggregateTreeFanout, kAllowLoopJoin, kBBoxIntersectAllowGpuBuild, kBBoxIntersectBucketThreshold, kBBoxIntersectKeysPerBin, kBBoxIntersectMaxSize, kBBoxIntersectNoCache, kColumnarOutput, kCpuMode, kCudaBlockSize, kCudaGridSize, kDisableLoopJoin, kDynamicWatchdog, kDynamicWatchdogOff, keep_result, keep_table_function_result, kforceBaselineHashJoin, kforceOneToManyHashJoin, kHintCount, kKeepResult, kKeepTableFuncResult, kLoopJoinInnerTableMaxNumRows, kMaxJoinHashTableSize, kOptCudaBlockAndGridSizes, kPreflightCountQueryThreshold, kQueryTimeLimit, kRowwiseOutput, kWatchdog, kWatchdogMaxProjectedRowsPerDevice, kWatchdogOff, loop_join_inner_table_max_num_rows, max_join_hash_table_size, preflight_count_query_threshold, query_time_limit, registered_hint, UNREACHABLE, use_loop_join, watchdog, and watchdog_max_projected_rows_per_device.

221  {
222  CHECK_EQ(registered_hint.size(), global_hints.registered_hint.size());
223  // apply registered global hint to the local hint if necessary
224  // we prioritize global hint when both side of hints are enabled simultaneously
225  RegisteredQueryHint updated_query_hints(*this);
226 
227  constexpr int num_hints = static_cast<int>(QueryHint::kHintCount);
228  for (int i = 0; i < num_hints; ++i) {
229  if (global_hints.registered_hint.at(i)) {
230  updated_query_hints.registered_hint.at(i) = true;
231  switch (static_cast<QueryHint>(i)) {
232  case QueryHint::kCpuMode:
233  updated_query_hints.cpu_mode = true;
234  break;
236  updated_query_hints.columnar_output = true;
237  break;
239  updated_query_hints.rowwise_output = true;
240  break;
242  updated_query_hints.cuda_block_size = global_hints.cuda_block_size;
243  break;
245  updated_query_hints.cuda_grid_size_multiplier =
246  global_hints.cuda_grid_size_multiplier;
247  break;
249  updated_query_hints.opt_cuda_grid_and_block_size = true;
250  break;
252  updated_query_hints.bbox_intersect_bucket_threshold =
253  global_hints.bbox_intersect_bucket_threshold;
254  break;
256  updated_query_hints.bbox_intersect_max_size =
257  global_hints.bbox_intersect_max_size;
258  break;
260  updated_query_hints.bbox_intersect_allow_gpu_build = true;
261  break;
263  updated_query_hints.bbox_intersect_no_cache = true;
264  break;
266  updated_query_hints.bbox_intersect_keys_per_bin =
267  global_hints.bbox_intersect_keys_per_bin;
268  break;
270  updated_query_hints.keep_result = global_hints.keep_result;
271  break;
273  updated_query_hints.keep_table_function_result =
274  global_hints.keep_table_function_result;
275  break;
277  updated_query_hints.aggregate_tree_fanout =
278  global_hints.aggregate_tree_fanout;
279  break;
282  updated_query_hints.watchdog = global_hints.watchdog;
283  break;
286  updated_query_hints.dynamic_watchdog = global_hints.dynamic_watchdog;
287  break;
289  updated_query_hints.query_time_limit = global_hints.query_time_limit;
290  break;
293  updated_query_hints.use_loop_join = global_hints.use_loop_join;
294  break;
296  updated_query_hints.loop_join_inner_table_max_num_rows =
298  break;
300  updated_query_hints.max_join_hash_table_size =
301  global_hints.max_join_hash_table_size;
302  break;
304  updated_query_hints.force_baseline_hash_join =
305  global_hints.force_baseline_hash_join;
306  break;
308  updated_query_hints.force_one_to_many_hash_join =
309  global_hints.force_one_to_many_hash_join;
310  break;
312  updated_query_hints.watchdog_max_projected_rows_per_device =
314  break;
316  updated_query_hints.preflight_count_query_threshold =
317  global_hints.preflight_count_query_threshold;
318  break;
319  default:
320  UNREACHABLE();
321  }
322  }
323  }
324  return updated_query_hints;
325  }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
double bbox_intersect_keys_per_bin
Definition: QueryHint.h:353
#define UNREACHABLE()
Definition: Logger.h:338
std::optional< bool > dynamic_watchdog
Definition: QueryHint.h:334
double cuda_grid_size_multiplier
Definition: QueryHint.h:341
size_t cuda_block_size
Definition: QueryHint.h:340
std::vector< bool > registered_hint
Definition: QueryHint.h:362
size_t max_join_hash_table_size
Definition: QueryHint.h:358
bool keep_table_function_result
Definition: QueryHint.h:332
size_t query_time_limit
Definition: QueryHint.h:335
double bbox_intersect_bucket_threshold
Definition: QueryHint.h:348
size_t watchdog_max_projected_rows_per_device
Definition: QueryHint.h:336
std::optional< bool > watchdog
Definition: QueryHint.h:333
size_t preflight_count_query_threshold
Definition: QueryHint.h:337
size_t bbox_intersect_max_size
Definition: QueryHint.h:350
bool force_baseline_hash_join
Definition: QueryHint.h:359
std::optional< bool > use_loop_join
Definition: QueryHint.h:356
size_t loop_join_inner_table_max_num_rows
Definition: QueryHint.h:357
size_t aggregate_tree_fanout
Definition: QueryHint.h:345
bool force_one_to_many_hash_join
Definition: QueryHint.h:360
void RegisteredQueryHint::registerHint ( const QueryHint  hint)
inline

Definition at line 378 of file QueryHint.h.

References registered_hint.

Referenced by RelAlgDag::registerQueryHints().

378  {
379  const auto hint_class = static_cast<int>(hint);
380  registered_hint.at(hint_class) = true;
381  }
std::vector< bool > registered_hint
Definition: QueryHint.h:362

+ Here is the caller graph for this function:

static QueryHint RegisteredQueryHint::translateQueryHint ( const std::string &  hint_name)
inlinestatic

Definition at line 367 of file QueryHint.h.

References kInvalidHint, and SupportedQueryHints.

Referenced by details::RelAlgDispatcher::parseHintString().

367  {
368  const auto lowered_hint_name = boost::algorithm::to_lower_copy(hint_name);
369  auto it = SupportedQueryHints.find(lowered_hint_name);
370  return it == SupportedQueryHints.end() ? QueryHint::kInvalidHint : it->second;
371  }
static const std::unordered_map< std::string, QueryHint > SupportedQueryHints
Definition: QueryHint.h:62

+ Here is the caller graph for this function:

Member Data Documentation

size_t RegisteredQueryHint::aggregate_tree_fanout
double RegisteredQueryHint::bbox_intersect_bucket_threshold
double RegisteredQueryHint::bbox_intersect_keys_per_bin
size_t RegisteredQueryHint::bbox_intersect_max_size
bool RegisteredQueryHint::bbox_intersect_no_cache

Definition at line 352 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints(), and boost::serialization::serialize().

bool RegisteredQueryHint::columnar_output

Definition at line 329 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints(), and boost::serialization::serialize().

bool RegisteredQueryHint::cpu_mode

Definition at line 328 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints(), and boost::serialization::serialize().

size_t RegisteredQueryHint::cuda_block_size
double RegisteredQueryHint::cuda_grid_size_multiplier
std::optional<bool> RegisteredQueryHint::dynamic_watchdog
bool RegisteredQueryHint::force_baseline_hash_join
bool RegisteredQueryHint::keep_result
bool RegisteredQueryHint::keep_table_function_result
size_t RegisteredQueryHint::loop_join_inner_table_max_num_rows
bool RegisteredQueryHint::opt_cuda_grid_and_block_size

Definition at line 342 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().

size_t RegisteredQueryHint::preflight_count_query_threshold
size_t RegisteredQueryHint::query_time_limit
std::vector<bool> RegisteredQueryHint::registered_hint
bool RegisteredQueryHint::rowwise_output

Definition at line 330 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints(), and boost::serialization::serialize().

std::optional<bool> RegisteredQueryHint::use_loop_join
std::optional<bool> RegisteredQueryHint::watchdog
size_t RegisteredQueryHint::watchdog_max_projected_rows_per_device

The documentation for this struct was generated from the following file: