OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CardinalityEstimator.h File Reference

Estimators to be used when precise cardinality isn't useful. More...

+ Include dependency graph for CardinalityEstimator.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CardinalityEstimationRequired
 
class  Analyzer::Estimator
 
class  Analyzer::NDVEstimator
 
class  Analyzer::LargeNDVEstimator
 

Namespaces

 Analyzer
 

Functions

ResultSetPtr reduce_estimator_results (const RelAlgExecutionUnit &ra_exe_unit, std::vector< std::pair< ResultSetPtr, std::vector< size_t >>> &results_per_device)
 

Detailed Description

Estimators to be used when precise cardinality isn't useful.

Definition in file CardinalityEstimator.h.

Function Documentation

ResultSetPtr reduce_estimator_results ( const RelAlgExecutionUnit ra_exe_unit,
std::vector< std::pair< ResultSetPtr, std::vector< size_t >>> &  results_per_device 
)

Definition at line 141 of file CardinalityEstimator.cpp.

References CHECK, and RelAlgExecutionUnit::estimator.

Referenced by Executor::reduceMultiDeviceResults().

143  {
144  if (results_per_device.empty()) {
145  return nullptr;
146  }
147  CHECK(dynamic_cast<const Analyzer::NDVEstimator*>(ra_exe_unit.estimator.get()));
148  const auto& result_set = results_per_device.front().first;
149  CHECK(result_set);
150  auto estimator_buffer = result_set->getHostEstimatorBuffer();
151  CHECK(estimator_buffer);
152  for (size_t i = 1; i < results_per_device.size(); ++i) {
153  const auto& next_result_set = results_per_device[i].first;
154  const auto other_estimator_buffer = next_result_set->getHostEstimatorBuffer();
155  for (size_t off = 0; off < ra_exe_unit.estimator->getBufferSize(); ++off) {
156  estimator_buffer[off] |= other_estimator_buffer[off];
157  }
158  }
159  return std::move(result_set);
160 }
const std::shared_ptr< Analyzer::Estimator > estimator
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function: