OmniSciDB  94e8789169
 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 467 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().

473  {
474  auto const& query_state = query_state_proxy.getQueryState();
475  const auto& cat = query_state.getConstSessionInfo()->getCatalog();
479 
481  true,
482  just_explain,
483  allow_loop_joins,
484  false,
485  false,
486  false,
487  false,
488  10000,
489  with_filter_push_down,
490  false,
492  false,
493  1000};
494  auto calcite_mgr = cat.getCalciteMgr();
495  const auto query_ra = calcite_mgr
496  ->process(query_state_proxy,
497  pg_shim(query_state.getQueryStr()),
498  {},
499  true,
500  false,
501  false,
502  true)
503  .plan_result;
504  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra);
505  const auto& query_hints = ra_executor.getParsedQueryHints();
506  if (query_hints.cpu_mode) {
508  }
509  auto result = std::make_shared<ExecutionResult>(
510  ra_executor.executeRelAlgQuery(co, eo, false, nullptr));
511  const auto& filter_push_down_requests = result->getPushedDownFilterInfo();
512  if (!filter_push_down_requests.empty()) {
513  std::vector<TFilterPushDownInfo> filter_push_down_info;
514  for (const auto& req : filter_push_down_requests) {
515  TFilterPushDownInfo filter_push_down_info_for_request;
516  filter_push_down_info_for_request.input_prev = req.input_prev;
517  filter_push_down_info_for_request.input_start = req.input_start;
518  filter_push_down_info_for_request.input_next = req.input_next;
519  filter_push_down_info.push_back(filter_push_down_info_for_request);
520  }
521  const auto new_query_ra = calcite_mgr
522  ->process(query_state_proxy,
523  pg_shim(query_state.getQueryStr()),
524  filter_push_down_info,
525  true,
526  false,
527  false,
528  true)
529  .plan_result;
530  const ExecutionOptions eo_modified{eo.output_columnar_hint,
531  eo.allow_multifrag,
532  eo.just_explain,
533  eo.allow_loop_joins,
534  eo.with_watchdog,
535  eo.jit_debug,
536  eo.just_validate,
539  /*find_push_down_candidates=*/false,
540  /*just_calcite_explain=*/false,
543  auto new_ra_executor = RelAlgExecutor(executor.get(), cat, new_query_ra);
544  return std::make_shared<ExecutionResult>(
545  new_ra_executor.executeRelAlgQuery(co, eo_modified, false, nullptr));
546  } else {
547  return result;
548  }
549 }
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:157
ExecutorOptLevel opt_level
bool g_enable_columnar_output
Definition: Execute.cpp:93
const bool allow_multifrag
const bool just_validate
QueryState & getQueryState()
Definition: QueryState.h:181
const bool with_dynamic_watchdog
const double gpu_input_mem_limit_percent
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:49
QueryHint getParsedQueryHints()
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:375

+ Here is the call graph for this function:

+ Here is the caller graph for this function: