OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SpeculativeTopN.cpp File Reference
#include "SpeculativeTopN.h"
#include "RelAlgExecutor.h"
#include "ResultSet.h"
#include "Shared/Logger.h"
+ Include dependency graph for SpeculativeTopN.cpp:

Go to the source code of this file.

Functions

bool use_speculative_top_n (const RelAlgExecutionUnit &ra_exe_unit, const QueryMemoryDescriptor &query_mem_desc)
 

Function Documentation

bool use_speculative_top_n ( const RelAlgExecutionUnit ra_exe_unit,
const QueryMemoryDescriptor query_mem_desc 
)

Definition at line 164 of file SpeculativeTopN.cpp.

References SortInfo::algorithm, g_cluster, kCOUNT, SortInfo::limit, RelAlgExecutionUnit::sort_info, QueryMemoryDescriptor::sortOnGpu(), SpeculativeTopN, and RelAlgExecutionUnit::target_exprs.

Referenced by Executor::collectAllDeviceResults(), RelAlgExecutor::executeSort(), and QueryExecutionContext::launchGpuCode().

165  {
166  if (g_cluster) {
167  return false;
168  }
169  if (ra_exe_unit.target_exprs.size() != 2) {
170  return false;
171  }
172  for (const auto target_expr : ra_exe_unit.target_exprs) {
173  const auto agg_expr = dynamic_cast<const Analyzer::AggExpr*>(target_expr);
174  if (agg_expr && agg_expr->get_aggtype() != kCOUNT) {
175  return false;
176  }
177  }
178  return query_mem_desc.sortOnGpu() && ra_exe_unit.sort_info.limit &&
180 }
std::vector< Analyzer::Expr * > target_exprs
bool g_cluster
const SortAlgorithm algorithm
const size_t limit
const SortInfo sort_info
Definition: sqldefs.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function: