OmniSciDB  cde582ebc3
 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 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:

Variable Documentation

size_t g_large_ndv_multiplier = 256
int64_t g_large_ndv_threshold = 10000000