OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QueryRunner::anonymous_namespace{QueryRunner.cpp} Namespace Reference

Functions

std::shared_ptr< ExecutionResultrun_select_query_with_filter_push_down (QueryStateProxy query_state_proxy, const ExecutorDeviceType device_type, const bool hoist_literals, const bool allow_loop_joins, const bool just_explain, const bool with_filter_push_down)
 

Function Documentation

std::shared_ptr<ExecutionResult> QueryRunner::anonymous_namespace{QueryRunner.cpp}::run_select_query_with_filter_push_down ( QueryStateProxy  query_state_proxy,
const ExecutorDeviceType  device_type,
const bool  hoist_literals,
const bool  allow_loop_joins,
const bool  just_explain,
const bool  with_filter_push_down 
)

Definition at line 432 of file QueryRunner.cpp.

References ExecutionOptions::allow_loop_joins, ExecutionOptions::allow_multifrag, ExecutionOptions::allow_runtime_query_interrupt, cat(), CPU, CompilationOptions::defaults(), CompilationOptions::device_type, ExecutionOptions::dynamic_watchdog_time_limit, g_enable_columnar_output, g_gpu_mem_limit_percent, Executor::getExecutor(), RelAlgExecutor::getParsedQueryHints(), query_state::QueryStateProxy::getQueryState(), ExecutionOptions::gpu_input_mem_limit_percent, ExecutionOptions::jit_debug, ExecutionOptions::just_explain, ExecutionOptions::just_validate, LoopStrengthReduction, CompilationOptions::opt_level, ExecutionOptions::output_columnar_hint, pg_shim(), run_benchmark_import::result, Executor::UNITARY_EXECUTOR_ID, ExecutionOptions::with_dynamic_watchdog, and ExecutionOptions::with_watchdog.

Referenced by QueryRunner::QueryRunner::runSelectQuery().

438  {
439  auto const& query_state = query_state_proxy.getQueryState();
440  const auto& cat = query_state.getConstSessionInfo()->getCatalog();
444 
446  true,
447  just_explain,
448  allow_loop_joins,
449  false,
450  false,
451  false,
452  false,
453  10000,
454  with_filter_push_down,
455  false,
457  false,
458  1000};
459  auto calcite_mgr = cat.getCalciteMgr();
460  const auto query_ra = calcite_mgr
461  ->process(query_state_proxy,
462  pg_shim(query_state.getQueryStr()),
463  {},
464  true,
465  false,
466  false,
467  true)
468  .plan_result;
469  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra);
470  const auto& query_hints = ra_executor.getParsedQueryHints();
471  if (query_hints.cpu_mode) {
473  }
474  auto result = std::make_shared<ExecutionResult>(
475  ra_executor.executeRelAlgQuery(co, eo, false, nullptr));
476  const auto& filter_push_down_requests = result->getPushedDownFilterInfo();
477  if (!filter_push_down_requests.empty()) {
478  std::vector<TFilterPushDownInfo> filter_push_down_info;
479  for (const auto& req : filter_push_down_requests) {
480  TFilterPushDownInfo filter_push_down_info_for_request;
481  filter_push_down_info_for_request.input_prev = req.input_prev;
482  filter_push_down_info_for_request.input_start = req.input_start;
483  filter_push_down_info_for_request.input_next = req.input_next;
484  filter_push_down_info.push_back(filter_push_down_info_for_request);
485  }
486  const auto new_query_ra = calcite_mgr
487  ->process(query_state_proxy,
488  pg_shim(query_state.getQueryStr()),
489  filter_push_down_info,
490  true,
491  false,
492  false,
493  true)
494  .plan_result;
495  const ExecutionOptions eo_modified{eo.output_columnar_hint,
496  eo.allow_multifrag,
497  eo.just_explain,
498  eo.allow_loop_joins,
499  eo.with_watchdog,
500  eo.jit_debug,
501  eo.just_validate,
504  /*find_push_down_candidates=*/false,
505  /*just_calcite_explain=*/false,
508  auto new_ra_executor = RelAlgExecutor(executor.get(), cat, new_query_ra);
509  return std::make_shared<ExecutionResult>(
510  new_ra_executor.executeRelAlgQuery(co, eo_modified, false, nullptr));
511  } else {
512  return result;
513  }
514 }
std::string cat(Ts &&...args)
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters system_parameters=SystemParameters())
Definition: Execute.cpp:150
ExecutorOptLevel opt_level
bool g_enable_columnar_output
Definition: Execute.cpp:90
const QueryHint getParsedQueryHints() const
const bool allow_multifrag
const bool just_validate
QueryState & getQueryState()
Definition: QueryState.h:172
const bool with_dynamic_watchdog
const double gpu_input_mem_limit_percent
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:48
ExecutorDeviceType device_type
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
const bool allow_loop_joins
const bool allow_runtime_query_interrupt
const unsigned dynamic_watchdog_time_limit
std::string pg_shim(const std::string &query)
const bool with_watchdog
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:337

+ Here is the call graph for this function:

+ Here is the caller graph for this function: