OmniSciDB  a5dc49c757
 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
 
bool table_reordering_off
 
double ndv_groups_estimator_multiplier
 
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 190 of file QueryHint.h.

Constructor & Destructor Documentation

RegisteredQueryHint::RegisteredQueryHint ( )
inline

Definition at line 198 of file QueryHint.h.

Referenced by defaults().

199  : cpu_mode(false)
200  , columnar_output(false)
201  , rowwise_output(false)
202  , keep_result(false)
204  , watchdog(std::nullopt)
205  , dynamic_watchdog(std::nullopt)
206  , query_time_limit(0)
209  , table_reordering_off(false)
211  , cuda_block_size(0)
215  , bbox_intersect_bucket_threshold(std::numeric_limits<double>::max())
218  , bbox_intersect_no_cache(false)
220  , use_loop_join(std::nullopt)
222  , max_join_hash_table_size(std::numeric_limits<size_t>::max())
223  , force_baseline_hash_join(false)
double bbox_intersect_keys_per_bin
Definition: QueryHint.h:368
size_t g_preflight_count_query_threshold
Definition: Execute.cpp:84
double g_bbox_intersect_target_entries_per_bin
Definition: Execute.cpp:115
std::optional< bool > dynamic_watchdog
Definition: QueryHint.h:347
double cuda_grid_size_multiplier
Definition: QueryHint.h:356
size_t cuda_block_size
Definition: QueryHint.h:355
std::vector< bool > registered_hint
Definition: QueryHint.h:377
unsigned g_trivial_loop_join_threshold
Definition: Execute.cpp:96
size_t max_join_hash_table_size
Definition: QueryHint.h:373
bool opt_cuda_grid_and_block_size
Definition: QueryHint.h:357
bool keep_table_function_result
Definition: QueryHint.h:345
size_t query_time_limit
Definition: QueryHint.h:348
double bbox_intersect_bucket_threshold
Definition: QueryHint.h:363
double ndv_groups_estimator_multiplier
Definition: QueryHint.h:352
size_t g_watchdog_max_projected_rows_per_device
Definition: Execute.cpp:83
size_t watchdog_max_projected_rows_per_device
Definition: QueryHint.h:349
std::optional< bool > watchdog
Definition: QueryHint.h:346
size_t preflight_count_query_threshold
Definition: QueryHint.h:350
size_t bbox_intersect_max_size
Definition: QueryHint.h:365
bool force_baseline_hash_join
Definition: QueryHint.h:374
bool bbox_intersect_no_cache
Definition: QueryHint.h:367
std::optional< bool > use_loop_join
Definition: QueryHint.h:371
size_t loop_join_inner_table_max_num_rows
Definition: QueryHint.h:372
bool bbox_intersect_allow_gpu_build
Definition: QueryHint.h:366
size_t aggregate_tree_fanout
Definition: QueryHint.h:360
bool force_one_to_many_hash_join
Definition: QueryHint.h:375
size_t g_bbox_intersect_max_table_size_bytes
Definition: Execute.cpp:114

+ Here is the caller graph for this function:

Member Function Documentation

static RegisteredQueryHint RegisteredQueryHint::defaults ( )
inlinestatic

Definition at line 379 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().

379 { 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 388 of file QueryHint.h.

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

Referenced by RelAlgDag::getQueryHint().

388  {
389  const auto identity = [](const bool b) { return b; };
390  return std::any_of(registered_hint.begin(), registered_hint.end(), identity);
391  }
std::vector< bool > registered_hint
Definition: QueryHint.h:377
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 227 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, kNDVGroupsEstimatorMultiplier, kOptCudaBlockAndGridSizes, kPreflightCountQueryThreshold, kQueryTimeLimit, kRowwiseOutput, kTableReorderingOff, kWatchdog, kWatchdogMaxProjectedRowsPerDevice, kWatchdogOff, loop_join_inner_table_max_num_rows, max_join_hash_table_size, ndv_groups_estimator_multiplier, preflight_count_query_threshold, query_time_limit, registered_hint, table_reordering_off, UNREACHABLE, use_loop_join, watchdog, and watchdog_max_projected_rows_per_device.

227  {
228  CHECK_EQ(registered_hint.size(), global_hints.registered_hint.size());
229  // apply registered global hint to the local hint if necessary
230  // we prioritize global hint when both side of hints are enabled simultaneously
231  RegisteredQueryHint updated_query_hints(*this);
232 
233  constexpr int num_hints = static_cast<int>(QueryHint::kHintCount);
234  for (int i = 0; i < num_hints; ++i) {
235  if (global_hints.registered_hint.at(i)) {
236  updated_query_hints.registered_hint.at(i) = true;
237  switch (static_cast<QueryHint>(i)) {
238  case QueryHint::kCpuMode:
239  updated_query_hints.cpu_mode = true;
240  break;
242  updated_query_hints.columnar_output = true;
243  break;
245  updated_query_hints.rowwise_output = true;
246  break;
248  updated_query_hints.cuda_block_size = global_hints.cuda_block_size;
249  break;
251  updated_query_hints.cuda_grid_size_multiplier =
252  global_hints.cuda_grid_size_multiplier;
253  break;
255  updated_query_hints.opt_cuda_grid_and_block_size = true;
256  break;
258  updated_query_hints.bbox_intersect_bucket_threshold =
259  global_hints.bbox_intersect_bucket_threshold;
260  break;
262  updated_query_hints.bbox_intersect_max_size =
263  global_hints.bbox_intersect_max_size;
264  break;
266  updated_query_hints.bbox_intersect_allow_gpu_build = true;
267  break;
269  updated_query_hints.bbox_intersect_no_cache = true;
270  break;
272  updated_query_hints.bbox_intersect_keys_per_bin =
273  global_hints.bbox_intersect_keys_per_bin;
274  break;
276  updated_query_hints.keep_result = global_hints.keep_result;
277  break;
279  updated_query_hints.keep_table_function_result =
280  global_hints.keep_table_function_result;
281  break;
283  updated_query_hints.aggregate_tree_fanout =
284  global_hints.aggregate_tree_fanout;
285  break;
288  updated_query_hints.watchdog = global_hints.watchdog;
289  break;
292  updated_query_hints.dynamic_watchdog = global_hints.dynamic_watchdog;
293  break;
295  updated_query_hints.query_time_limit = global_hints.query_time_limit;
296  break;
299  updated_query_hints.use_loop_join = global_hints.use_loop_join;
300  break;
302  updated_query_hints.loop_join_inner_table_max_num_rows =
304  break;
306  updated_query_hints.max_join_hash_table_size =
307  global_hints.max_join_hash_table_size;
308  break;
310  updated_query_hints.force_baseline_hash_join =
311  global_hints.force_baseline_hash_join;
312  break;
314  updated_query_hints.force_one_to_many_hash_join =
315  global_hints.force_one_to_many_hash_join;
316  break;
318  updated_query_hints.watchdog_max_projected_rows_per_device =
320  break;
322  updated_query_hints.preflight_count_query_threshold =
323  global_hints.preflight_count_query_threshold;
324  break;
326  updated_query_hints.table_reordering_off = global_hints.table_reordering_off;
327  break;
329  updated_query_hints.ndv_groups_estimator_multiplier =
330  global_hints.ndv_groups_estimator_multiplier;
331  break;
332  default:
333  UNREACHABLE();
334  }
335  }
336  }
337  return updated_query_hints;
338  }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
double bbox_intersect_keys_per_bin
Definition: QueryHint.h:368
#define UNREACHABLE()
Definition: Logger.h:338
std::optional< bool > dynamic_watchdog
Definition: QueryHint.h:347
double cuda_grid_size_multiplier
Definition: QueryHint.h:356
size_t cuda_block_size
Definition: QueryHint.h:355
std::vector< bool > registered_hint
Definition: QueryHint.h:377
size_t max_join_hash_table_size
Definition: QueryHint.h:373
bool keep_table_function_result
Definition: QueryHint.h:345
size_t query_time_limit
Definition: QueryHint.h:348
double bbox_intersect_bucket_threshold
Definition: QueryHint.h:363
double ndv_groups_estimator_multiplier
Definition: QueryHint.h:352
size_t watchdog_max_projected_rows_per_device
Definition: QueryHint.h:349
std::optional< bool > watchdog
Definition: QueryHint.h:346
size_t preflight_count_query_threshold
Definition: QueryHint.h:350
size_t bbox_intersect_max_size
Definition: QueryHint.h:365
bool force_baseline_hash_join
Definition: QueryHint.h:374
std::optional< bool > use_loop_join
Definition: QueryHint.h:371
size_t loop_join_inner_table_max_num_rows
Definition: QueryHint.h:372
size_t aggregate_tree_fanout
Definition: QueryHint.h:360
bool force_one_to_many_hash_join
Definition: QueryHint.h:375
void RegisteredQueryHint::registerHint ( const QueryHint  hint)
inline

Definition at line 393 of file QueryHint.h.

References registered_hint.

Referenced by RelAlgDag::registerQueryHints().

393  {
394  const auto hint_class = static_cast<int>(hint);
395  registered_hint.at(hint_class) = true;
396  }
std::vector< bool > registered_hint
Definition: QueryHint.h:377

+ Here is the caller graph for this function:

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

Definition at line 382 of file QueryHint.h.

References kInvalidHint, and SupportedQueryHints.

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

382  {
383  const auto lowered_hint_name = boost::algorithm::to_lower_copy(hint_name);
384  auto it = SupportedQueryHints.find(lowered_hint_name);
385  return it == SupportedQueryHints.end() ? QueryHint::kInvalidHint : it->second;
386  }
static const std::unordered_map< std::string, QueryHint > SupportedQueryHints
Definition: QueryHint.h:64

+ 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 367 of file QueryHint.h.

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

bool RegisteredQueryHint::columnar_output

Definition at line 342 of file QueryHint.h.

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

bool RegisteredQueryHint::cpu_mode

Definition at line 341 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
double RegisteredQueryHint::ndv_groups_estimator_multiplier
bool RegisteredQueryHint::opt_cuda_grid_and_block_size

Definition at line 357 of file QueryHint.h.

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

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 343 of file QueryHint.h.

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

bool RegisteredQueryHint::table_reordering_off
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: