OmniSciDB  91042dcc5b
 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
 
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 140 of file QueryHint.h.

Constructor & Destructor Documentation

RegisteredQueryHint::RegisteredQueryHint ( )
inline

Definition at line 146 of file QueryHint.h.

Referenced by defaults().

147  : cpu_mode(false)
148  , columnar_output(false)
149  , rowwise_output(false)
150  , overlaps_bucket_threshold(std::numeric_limits<double>::max())
152  , overlaps_allow_gpu_build(false)
153  , overlaps_no_cache(false)
bool overlaps_allow_gpu_build
Definition: QueryHint.h:216
double overlaps_keys_per_bin
Definition: QueryHint.h:218
std::vector< bool > registered_hint
Definition: QueryHint.h:220
double g_overlaps_target_entries_per_bin
Definition: Execute.cpp:103
size_t g_overlaps_max_table_size_bytes
Definition: Execute.cpp:102
size_t overlaps_max_size
Definition: QueryHint.h:215
double overlaps_bucket_threshold
Definition: QueryHint.h:214

+ Here is the caller graph for this function:

Member Function Documentation

static RegisteredQueryHint RegisteredQueryHint::defaults ( )
inlinestatic

Definition at line 222 of file QueryHint.h.

References RegisteredQueryHint().

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

222 { 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 231 of file QueryHint.h.

References registered_hint.

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

231  {
232  const auto identity = [](const bool b) { return b; };
233  return std::any_of(registered_hint.begin(), registered_hint.end(), identity);
234  }
std::vector< bool > registered_hint
Definition: QueryHint.h:220

+ Here is the caller graph for this function:

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

Definition at line 241 of file QueryHint.h.

References registered_hint.

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

241  {
242  const auto hint_class = static_cast<int>(hint);
243  return registered_hint.at(hint_class);
244  }
std::vector< bool > registered_hint
Definition: QueryHint.h:220

+ Here is the caller graph for this function:

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

Definition at line 157 of file QueryHint.h.

References CHECK_EQ, i, kColumnarOutput, kCpuMode, kHintCount, kOverlapsAllowGpuBuild, kOverlapsBucketThreshold, kOverlapsKeysPerBin, kOverlapsMaxSize, kOverlapsNoCache, kRowwiseOutput, overlaps_bucket_threshold, overlaps_keys_per_bin, overlaps_max_size, and registered_hint.

157  {
158  CHECK_EQ(registered_hint.size(), global_hints.registered_hint.size());
159  // apply registered global hint to the local hint if necessary
160  // we prioritize global hint when both side of hints are enabled simultaneously
161  RegisteredQueryHint updated_query_hints(*this);
162 
163  int num_hints = static_cast<int>(QueryHint::kHintCount);
164  for (int i = 0; i < num_hints; ++i) {
165  if (global_hints.registered_hint.at(i)) {
166  updated_query_hints.registered_hint.at(i) = global_hints.registered_hint[i];
167  switch (i) {
168  case static_cast<int>(QueryHint::kCpuMode): {
169  updated_query_hints.cpu_mode = true;
170  break;
171  }
172  case static_cast<int>(QueryHint::kColumnarOutput): {
173  updated_query_hints.columnar_output = true;
174  break;
175  }
176  case static_cast<int>(QueryHint::kRowwiseOutput): {
177  updated_query_hints.rowwise_output = true;
178  break;
179  }
180  case static_cast<int>(QueryHint::kOverlapsBucketThreshold): {
181  updated_query_hints.overlaps_bucket_threshold =
182  global_hints.overlaps_bucket_threshold;
183  break;
184  }
185  case static_cast<int>(QueryHint::kOverlapsMaxSize): {
186  updated_query_hints.overlaps_max_size = global_hints.overlaps_max_size;
187  break;
188  }
189  case static_cast<int>(QueryHint::kOverlapsAllowGpuBuild): {
190  updated_query_hints.overlaps_allow_gpu_build = true;
191  break;
192  }
193  case static_cast<int>(QueryHint::kOverlapsNoCache): {
194  updated_query_hints.overlaps_no_cache = true;
195  break;
196  }
197  case static_cast<int>(QueryHint::kOverlapsKeysPerBin): {
198  updated_query_hints.overlaps_keys_per_bin =
199  global_hints.overlaps_keys_per_bin;
200  break;
201  }
202  }
203  }
204  }
205  return updated_query_hints;
206  }
#define CHECK_EQ(x, y)
Definition: Logger.h:219
double overlaps_keys_per_bin
Definition: QueryHint.h:218
std::vector< bool > registered_hint
Definition: QueryHint.h:220
size_t overlaps_max_size
Definition: QueryHint.h:215
double overlaps_bucket_threshold
Definition: QueryHint.h:214
void RegisteredQueryHint::registerHint ( const QueryHint  hint)
inline

Definition at line 236 of file QueryHint.h.

References registered_hint.

Referenced by RelAlgDagBuilder::registerQueryHints().

236  {
237  const auto hint_class = static_cast<int>(hint);
238  registered_hint.at(hint_class) = true;
239  }
std::vector< bool > registered_hint
Definition: QueryHint.h:220

+ Here is the caller graph for this function:

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

Definition at line 225 of file QueryHint.h.

References kInvalidHint, and SupportedQueryHints.

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

225  {
226  const auto lowered_hint_name = boost::algorithm::to_lower_copy(hint_name);
227  auto it = SupportedQueryHints.find(lowered_hint_name);
228  return it == SupportedQueryHints.end() ? QueryHint::kInvalidHint : it->second;
229  }
static const std::unordered_map< std::string, QueryHint > SupportedQueryHints
Definition: QueryHint.h:43

+ Here is the caller graph for this function:

Member Data Documentation

bool RegisteredQueryHint::columnar_output

Definition at line 210 of file QueryHint.h.

Referenced by RelAlgDagBuilder::registerQueryHints().

bool RegisteredQueryHint::cpu_mode

Definition at line 209 of file QueryHint.h.

Referenced by RelAlgDagBuilder::registerQueryHints().

bool RegisteredQueryHint::overlaps_allow_gpu_build
double RegisteredQueryHint::overlaps_bucket_threshold

Definition at line 214 of file QueryHint.h.

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

double RegisteredQueryHint::overlaps_keys_per_bin

Definition at line 218 of file QueryHint.h.

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

size_t RegisteredQueryHint::overlaps_max_size

Definition at line 215 of file QueryHint.h.

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

bool RegisteredQueryHint::overlaps_no_cache

Definition at line 217 of file QueryHint.h.

Referenced by RelAlgDagBuilder::registerQueryHints().

std::vector<bool> RegisteredQueryHint::registered_hint

Definition at line 220 of file QueryHint.h.

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

bool RegisteredQueryHint::rowwise_output

Definition at line 211 of file QueryHint.h.

Referenced by RelAlgDagBuilder::registerQueryHints().


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