OmniSciDB  8fa3bf436f
 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 528 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, kCpuMode, LoopStrengthReduction, CompilationOptions::opt_level, ExecutionOptions::output_columnar_hint, ExecutionOptions::pending_query_interrupt_freq, pg_shim(), run_benchmark_import::result, ExecutionOptions::running_query_interrupt_freq, Executor::UNITARY_EXECUTOR_ID, ExecutionOptions::with_dynamic_watchdog, and ExecutionOptions::with_watchdog.

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

534  {
535  auto const& query_state = query_state_proxy.getQueryState();
536  const auto& cat = query_state.getConstSessionInfo()->getCatalog();
540 
542  true,
543  just_explain,
544  allow_loop_joins,
545  false,
546  false,
547  false,
548  false,
549  10000,
550  with_filter_push_down,
551  false,
553  false};
554  auto calcite_mgr = cat.getCalciteMgr();
555  const auto query_ra = calcite_mgr
556  ->process(query_state_proxy,
557  pg_shim(query_state.getQueryStr()),
558  {},
559  true,
560  false,
561  false,
562  true)
563  .plan_result;
564  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra);
565  const auto& query_hints = ra_executor.getParsedQueryHints();
566  const bool cpu_mode_enabled = query_hints.isHintRegistered(QueryHint::kCpuMode);
567  if (cpu_mode_enabled) {
569  }
570  auto result = std::make_shared<ExecutionResult>(
571  ra_executor.executeRelAlgQuery(co, eo, false, nullptr));
572  const auto& filter_push_down_requests = result->getPushedDownFilterInfo();
573  if (!filter_push_down_requests.empty()) {
574  std::vector<TFilterPushDownInfo> filter_push_down_info;
575  for (const auto& req : filter_push_down_requests) {
576  TFilterPushDownInfo filter_push_down_info_for_request;
577  filter_push_down_info_for_request.input_prev = req.input_prev;
578  filter_push_down_info_for_request.input_start = req.input_start;
579  filter_push_down_info_for_request.input_next = req.input_next;
580  filter_push_down_info.push_back(filter_push_down_info_for_request);
581  }
582  const auto new_query_ra = calcite_mgr
583  ->process(query_state_proxy,
584  pg_shim(query_state.getQueryStr()),
585  filter_push_down_info,
586  true,
587  false,
588  false,
589  true)
590  .plan_result;
591  const ExecutionOptions eo_modified{eo.output_columnar_hint,
592  eo.allow_multifrag,
593  eo.just_explain,
594  eo.allow_loop_joins,
595  eo.with_watchdog,
596  eo.jit_debug,
597  eo.just_validate,
600  /*find_push_down_candidates=*/false,
601  /*just_calcite_explain=*/false,
606  auto new_ra_executor = RelAlgExecutor(executor.get(), cat, new_query_ra);
607  return std::make_shared<ExecutionResult>(
608  new_ra_executor.executeRelAlgQuery(co, eo_modified, false, nullptr));
609  } else {
610  return result;
611  }
612 }
std::string cat(Ts &&...args)
ExecutorOptLevel opt_level
double running_query_interrupt_freq
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:163
bool g_enable_columnar_output
Definition: Execute.cpp:93
QueryState & getQueryState()
Definition: QueryState.h:175
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:49
unsigned pending_query_interrupt_freq
ExecutorDeviceType device_type
RegisteredQueryHint getParsedQueryHints()
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
double gpu_input_mem_limit_percent
unsigned dynamic_watchdog_time_limit
std::string pg_shim(const std::string &query)
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:366

+ Here is the call graph for this function:

+ Here is the caller graph for this function: