OmniSciDB  ca0c39ec8f
 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
 
size_t cuda_block_size
 
double cuda_grid_size_multiplier
 
size_t aggregate_tree_fanout
 
double overlaps_bucket_threshold
 
size_t overlaps_max_size
 
bool overlaps_allow_gpu_build
 
bool overlaps_no_cache
 
double overlaps_keys_per_bin
 
std::vector< bool > registered_hint
 

Detailed Description

Definition at line 151 of file QueryHint.h.

Constructor & Destructor Documentation

RegisteredQueryHint::RegisteredQueryHint ( )
inline

Definition at line 157 of file QueryHint.h.

Referenced by defaults().

158  : cpu_mode(false)
159  , columnar_output(false)
160  , rowwise_output(false)
161  , keep_result(false)
163  , cuda_block_size(0)
166  , overlaps_bucket_threshold(std::numeric_limits<double>::max())
168  , overlaps_allow_gpu_build(false)
169  , overlaps_no_cache(false)
bool overlaps_allow_gpu_build
Definition: QueryHint.h:263
double overlaps_keys_per_bin
Definition: QueryHint.h:265
double cuda_grid_size_multiplier
Definition: QueryHint.h:255
size_t cuda_block_size
Definition: QueryHint.h:254
std::vector< bool > registered_hint
Definition: QueryHint.h:267
bool keep_table_function_result
Definition: QueryHint.h:251
double g_overlaps_target_entries_per_bin
Definition: Execute.cpp:106
size_t g_overlaps_max_table_size_bytes
Definition: Execute.cpp:105
size_t overlaps_max_size
Definition: QueryHint.h:262
double overlaps_bucket_threshold
Definition: QueryHint.h:261
size_t aggregate_tree_fanout
Definition: QueryHint.h:258

+ Here is the caller graph for this function:

Member Function Documentation

static RegisteredQueryHint RegisteredQueryHint::defaults ( )
inlinestatic

Definition at line 269 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(), HashJoin::getSyntheticInstance(), and OverlapsJoinHashTable::OverlapsJoinHashTable().

269 { 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 278 of file QueryHint.h.

References registered_hint.

Referenced by OverlapsJoinHashTable::getInstance(), and RelAlgDag::getQueryHint().

278  {
279  const auto identity = [](const bool b) { return b; };
280  return std::any_of(registered_hint.begin(), registered_hint.end(), identity);
281  }
std::vector< bool > registered_hint
Definition: QueryHint.h:267

+ Here is the caller graph for this function:

bool RegisteredQueryHint::isHintRegistered ( const QueryHint  hint) const
inline

Definition at line 288 of file QueryHint.h.

References registered_hint.

Referenced by OverlapsJoinHashTable::getEffectiveMemoryLevel(), and OverlapsJoinHashTable::reifyWithLayout().

288  {
289  const auto hint_class = static_cast<int>(hint);
290  return registered_hint.at(hint_class);
291  }
std::vector< bool > registered_hint
Definition: QueryHint.h:267

+ Here is the caller graph for this function:

RegisteredQueryHint RegisteredQueryHint::operator|| ( const RegisteredQueryHint global_hints) const
inline

Definition at line 173 of file QueryHint.h.

References aggregate_tree_fanout, CHECK_EQ, cuda_block_size, cuda_grid_size_multiplier, kAggregateTreeFanout, kColumnarOutput, kCpuMode, kCudaBlockSize, kCudaGridSize, keep_result, keep_table_function_result, kHintCount, kKeepResult, kKeepTableFuncResult, kOverlapsAllowGpuBuild, kOverlapsBucketThreshold, kOverlapsKeysPerBin, kOverlapsMaxSize, kOverlapsNoCache, kRowwiseOutput, overlaps_bucket_threshold, overlaps_keys_per_bin, overlaps_max_size, and registered_hint.

173  {
174  CHECK_EQ(registered_hint.size(), global_hints.registered_hint.size());
175  // apply registered global hint to the local hint if necessary
176  // we prioritize global hint when both side of hints are enabled simultaneously
177  RegisteredQueryHint updated_query_hints(*this);
178 
179  int num_hints = static_cast<int>(QueryHint::kHintCount);
180  for (int i = 0; i < num_hints; ++i) {
181  if (global_hints.registered_hint.at(i)) {
182  updated_query_hints.registered_hint.at(i) = global_hints.registered_hint[i];
183  switch (i) {
184  case static_cast<int>(QueryHint::kCpuMode): {
185  updated_query_hints.cpu_mode = true;
186  break;
187  }
188  case static_cast<int>(QueryHint::kColumnarOutput): {
189  updated_query_hints.columnar_output = true;
190  break;
191  }
192  case static_cast<int>(QueryHint::kRowwiseOutput): {
193  updated_query_hints.rowwise_output = true;
194  break;
195  }
196  case static_cast<int>(QueryHint::kCudaBlockSize): {
197  updated_query_hints.cuda_block_size = global_hints.cuda_block_size;
198  break;
199  }
200  case static_cast<int>(QueryHint::kCudaGridSize): {
201  updated_query_hints.cuda_grid_size_multiplier =
202  global_hints.cuda_grid_size_multiplier;
203  break;
204  }
205  case static_cast<int>(QueryHint::kOverlapsBucketThreshold): {
206  updated_query_hints.overlaps_bucket_threshold =
207  global_hints.overlaps_bucket_threshold;
208  break;
209  }
210  case static_cast<int>(QueryHint::kOverlapsMaxSize): {
211  updated_query_hints.overlaps_max_size = global_hints.overlaps_max_size;
212  break;
213  }
214  case static_cast<int>(QueryHint::kOverlapsAllowGpuBuild): {
215  updated_query_hints.overlaps_allow_gpu_build = true;
216  break;
217  }
218  case static_cast<int>(QueryHint::kOverlapsNoCache): {
219  updated_query_hints.overlaps_no_cache = true;
220  break;
221  }
222  case static_cast<int>(QueryHint::kOverlapsKeysPerBin): {
223  updated_query_hints.overlaps_keys_per_bin =
224  global_hints.overlaps_keys_per_bin;
225  break;
226  }
227  case static_cast<int>(QueryHint::kKeepResult): {
228  updated_query_hints.keep_result = global_hints.keep_result;
229  break;
230  }
231  case static_cast<int>(QueryHint::kKeepTableFuncResult): {
232  updated_query_hints.keep_table_function_result =
233  global_hints.keep_table_function_result;
234  break;
235  }
236  case static_cast<int>(QueryHint::kAggregateTreeFanout): {
237  updated_query_hints.aggregate_tree_fanout =
238  global_hints.aggregate_tree_fanout;
239  }
240  }
241  }
242  }
243  return updated_query_hints;
244  }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
double overlaps_keys_per_bin
Definition: QueryHint.h:265
double cuda_grid_size_multiplier
Definition: QueryHint.h:255
size_t cuda_block_size
Definition: QueryHint.h:254
std::vector< bool > registered_hint
Definition: QueryHint.h:267
bool keep_table_function_result
Definition: QueryHint.h:251
size_t overlaps_max_size
Definition: QueryHint.h:262
double overlaps_bucket_threshold
Definition: QueryHint.h:261
size_t aggregate_tree_fanout
Definition: QueryHint.h:258
void RegisteredQueryHint::registerHint ( const QueryHint  hint)
inline

Definition at line 283 of file QueryHint.h.

References registered_hint.

Referenced by RelAlgDag::registerQueryHints().

283  {
284  const auto hint_class = static_cast<int>(hint);
285  registered_hint.at(hint_class) = true;
286  }
std::vector< bool > registered_hint
Definition: QueryHint.h:267

+ Here is the caller graph for this function:

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

Definition at line 272 of file QueryHint.h.

References kInvalidHint, and SupportedQueryHints.

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

272  {
273  const auto lowered_hint_name = boost::algorithm::to_lower_copy(hint_name);
274  auto it = SupportedQueryHints.find(lowered_hint_name);
275  return it == SupportedQueryHints.end() ? QueryHint::kInvalidHint : it->second;
276  }
static const std::unordered_map< std::string, QueryHint > SupportedQueryHints
Definition: QueryHint.h:48

+ Here is the caller graph for this function:

Member Data Documentation

size_t RegisteredQueryHint::aggregate_tree_fanout
bool RegisteredQueryHint::columnar_output

Definition at line 248 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().

bool RegisteredQueryHint::cpu_mode

Definition at line 247 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().

size_t RegisteredQueryHint::cuda_block_size

Definition at line 254 of file QueryHint.h.

Referenced by operator||(), and RelAlgDag::registerQueryHints().

double RegisteredQueryHint::cuda_grid_size_multiplier

Definition at line 255 of file QueryHint.h.

Referenced by operator||(), and RelAlgDag::registerQueryHints().

bool RegisteredQueryHint::keep_result

Definition at line 250 of file QueryHint.h.

Referenced by operator||(), and RelAlgDag::registerQueryHints().

bool RegisteredQueryHint::keep_table_function_result

Definition at line 251 of file QueryHint.h.

Referenced by operator||(), and RelAlgDag::registerQueryHints().

bool RegisteredQueryHint::overlaps_allow_gpu_build
double RegisteredQueryHint::overlaps_bucket_threshold

Definition at line 261 of file QueryHint.h.

Referenced by operator||(), and RelAlgDag::registerQueryHints().

double RegisteredQueryHint::overlaps_keys_per_bin

Definition at line 265 of file QueryHint.h.

Referenced by operator||(), and RelAlgDag::registerQueryHints().

size_t RegisteredQueryHint::overlaps_max_size

Definition at line 262 of file QueryHint.h.

Referenced by operator||(), and RelAlgDag::registerQueryHints().

bool RegisteredQueryHint::overlaps_no_cache

Definition at line 264 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().

std::vector<bool> RegisteredQueryHint::registered_hint

Definition at line 267 of file QueryHint.h.

Referenced by isAnyQueryHintDelivered(), isHintRegistered(), operator||(), and registerHint().

bool RegisteredQueryHint::rowwise_output

Definition at line 249 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().


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