OmniSciDB  cde582ebc3
 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 139 of file CardinalityEstimator.cpp.

References CHECK, and RelAlgExecutionUnit::estimator.

Referenced by Executor::reduceMultiDeviceResults().

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

+ Here is the caller graph for this function: