OmniSciDB  c1a53651b2
 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 140 of file CardinalityEstimator.cpp.

References CHECK, and RelAlgExecutionUnit::estimator.

Referenced by Executor::reduceMultiDeviceResults().

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