OmniSciDB  8a228a1076
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

◆ run_select_query_with_filter_push_down()

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 439 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().

445  {
446  auto const& query_state = query_state_proxy.getQueryState();
447  const auto& cat = query_state.getConstSessionInfo()->getCatalog();
451 
453  true,
454  just_explain,
455  allow_loop_joins,
456  false,
457  false,
458  false,
459  false,
460  10000,
461  with_filter_push_down,
462  false,
464  false,
465  1000};
466  auto calcite_mgr = cat.getCalciteMgr();
467  const auto query_ra = calcite_mgr
468  ->process(query_state_proxy,
469  pg_shim(query_state.getQueryStr()),
470  {},
471  true,
472  false,
473  false,
474  true)
475  .plan_result;
476  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra);
477  const auto& query_hints = ra_executor.getParsedQueryHints();
478  if (query_hints.cpu_mode) {
480  }
481  auto result = std::make_shared<ExecutionResult>(
482  ra_executor.executeRelAlgQuery(co, eo, false, nullptr));
483  const auto& filter_push_down_requests = result->getPushedDownFilterInfo();
484  if (!filter_push_down_requests.empty()) {
485  std::vector<TFilterPushDownInfo> filter_push_down_info;
486  for (const auto& req : filter_push_down_requests) {
487  TFilterPushDownInfo filter_push_down_info_for_request;
488  filter_push_down_info_for_request.input_prev = req.input_prev;
489  filter_push_down_info_for_request.input_start = req.input_start;
490  filter_push_down_info_for_request.input_next = req.input_next;
491  filter_push_down_info.push_back(filter_push_down_info_for_request);
492  }
493  const auto new_query_ra = calcite_mgr
494  ->process(query_state_proxy,
495  pg_shim(query_state.getQueryStr()),
496  filter_push_down_info,
497  true,
498  false,
499  false,
500  true)
501  .plan_result;
502  const ExecutionOptions eo_modified{eo.output_columnar_hint,
503  eo.allow_multifrag,
504  eo.just_explain,
505  eo.allow_loop_joins,
506  eo.with_watchdog,
507  eo.jit_debug,
508  eo.just_validate,
511  /*find_push_down_candidates=*/false,
512  /*just_calcite_explain=*/false,
515  auto new_ra_executor = RelAlgExecutor(executor.get(), cat, new_query_ra);
516  return std::make_shared<ExecutionResult>(
517  new_ra_executor.executeRelAlgQuery(co, eo_modified, false, nullptr));
518  } else {
519  return result;
520  }
521 }
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:148
ExecutorOptLevel opt_level
bool g_enable_columnar_output
Definition: Execute.cpp:90
const bool allow_multifrag
std::string cat(Ts &&... args)
const bool just_validate
QueryState & getQueryState()
Definition: QueryState.h:172
const bool with_dynamic_watchdog
const QueryHint getParsedQueryHints() const
const double gpu_input_mem_limit_percent
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:47
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:303
+ Here is the call graph for this function:
+ Here is the caller graph for this function: