OmniSciDB  cde582ebc3
 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 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 146 of file QueryHint.h.

Constructor & Destructor Documentation

RegisteredQueryHint::RegisteredQueryHint ( )
inline

Definition at line 152 of file QueryHint.h.

Referenced by defaults().

153  : cpu_mode(false)
154  , columnar_output(false)
155  , rowwise_output(false)
157  , overlaps_bucket_threshold(std::numeric_limits<double>::max())
159  , overlaps_allow_gpu_build(false)
160  , overlaps_no_cache(false)
bool overlaps_allow_gpu_build
Definition: QueryHint.h:241
double overlaps_keys_per_bin
Definition: QueryHint.h:243
std::vector< bool > registered_hint
Definition: QueryHint.h:245
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:240
double overlaps_bucket_threshold
Definition: QueryHint.h:239
size_t aggregate_tree_fanout
Definition: QueryHint.h:236

+ Here is the caller graph for this function:

Member Function Documentation

static RegisteredQueryHint RegisteredQueryHint::defaults ( )
inlinestatic

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

247 { 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 256 of file QueryHint.h.

References registered_hint.

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

256  {
257  const auto identity = [](const bool b) { return b; };
258  return std::any_of(registered_hint.begin(), registered_hint.end(), identity);
259  }
std::vector< bool > registered_hint
Definition: QueryHint.h:245

+ Here is the caller graph for this function:

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

Definition at line 266 of file QueryHint.h.

References registered_hint.

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

266  {
267  const auto hint_class = static_cast<int>(hint);
268  return registered_hint.at(hint_class);
269  }
std::vector< bool > registered_hint
Definition: QueryHint.h:245

+ Here is the caller graph for this function:

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

Definition at line 164 of file QueryHint.h.

References aggregate_tree_fanout, CHECK_EQ, kAggregateTreeFanout, kColumnarOutput, kCpuMode, 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.

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

Definition at line 261 of file QueryHint.h.

References registered_hint.

Referenced by RelAlgDag::registerQueryHints().

261  {
262  const auto hint_class = static_cast<int>(hint);
263  registered_hint.at(hint_class) = true;
264  }
std::vector< bool > registered_hint
Definition: QueryHint.h:245

+ Here is the caller graph for this function:

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

Definition at line 250 of file QueryHint.h.

References kInvalidHint, and SupportedQueryHints.

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

250  {
251  const auto lowered_hint_name = boost::algorithm::to_lower_copy(hint_name);
252  auto it = SupportedQueryHints.find(lowered_hint_name);
253  return it == SupportedQueryHints.end() ? QueryHint::kInvalidHint : it->second;
254  }
static const std::unordered_map< std::string, QueryHint > SupportedQueryHints
Definition: QueryHint.h:46

+ Here is the caller graph for this function:

Member Data Documentation

size_t RegisteredQueryHint::aggregate_tree_fanout
bool RegisteredQueryHint::columnar_output

Definition at line 230 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().

bool RegisteredQueryHint::cpu_mode

Definition at line 229 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().

bool RegisteredQueryHint::keep_result

Definition at line 232 of file QueryHint.h.

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

bool RegisteredQueryHint::keep_table_function_result

Definition at line 233 of file QueryHint.h.

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

bool RegisteredQueryHint::overlaps_allow_gpu_build
double RegisteredQueryHint::overlaps_bucket_threshold

Definition at line 239 of file QueryHint.h.

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

double RegisteredQueryHint::overlaps_keys_per_bin

Definition at line 243 of file QueryHint.h.

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

size_t RegisteredQueryHint::overlaps_max_size

Definition at line 240 of file QueryHint.h.

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

bool RegisteredQueryHint::overlaps_no_cache

Definition at line 242 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().

std::vector<bool> RegisteredQueryHint::registered_hint

Definition at line 245 of file QueryHint.h.

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

bool RegisteredQueryHint::rowwise_output

Definition at line 231 of file QueryHint.h.

Referenced by RelAlgDag::registerQueryHints().


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