OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CardinalityEstimator.cpp File Reference
#include "CardinalityEstimator.h"
#include "ErrorHandling.h"
#include "ExpressionRewrite.h"
#include "RelAlgExecutor.h"
+ Include dependency graph for CardinalityEstimator.cpp:

Go to the source code of this file.

Namespaces

 Analyzer
 

Functions

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

Variables

int64_t g_large_ndv_threshold = 10000000
 
size_t g_large_ndv_multiplier = 256
 

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:

Variable Documentation

size_t g_large_ndv_multiplier = 256
int64_t g_large_ndv_threshold = 10000000