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

Functions

ExecutionResult 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)
 

Function Documentation

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 348 of file QueryRunner.cpp.

References ExecutionOptions::allow_loop_joins, ExecutionOptions::allow_multifrag, ExecutionOptions::dynamic_watchdog_time_limit, g_enable_columnar_output, g_gpu_mem_limit_percent, query_state::QueryState::getConstSessionInfo(), Executor::getExecutor(), query_state::QueryStateProxy::getQueryState(), ExecutionOptions::gpu_input_mem_limit_percent, ExecutionOptions::jit_debug, ExecutionOptions::just_explain, ExecutionOptions::just_validate, LoopStrengthReduction, ExecutionOptions::output_columnar_hint, pg_shim(), run_benchmark_import::result, ExecutionOptions::with_dynamic_watchdog, and ExecutionOptions::with_watchdog.

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

354  {
355  auto const& query_state = query_state_proxy.getQueryState();
356  const auto& cat = query_state.getConstSessionInfo()->getCatalog();
357  auto executor = Executor::getExecutor(cat.getCurrentDB().dbId);
358  CompilationOptions co = {
359  device_type, true, ExecutorOptLevel::LoopStrengthReduction, false};
361  true,
362  just_explain,
363  allow_loop_joins,
364  false,
365  false,
366  false,
367  false,
368  10000,
369  with_filter_push_down,
370  false,
372  auto calcite_mgr = cat.getCalciteMgr();
373  const auto query_ra = calcite_mgr
374  ->process(query_state_proxy,
375  pg_shim(query_state.getQueryStr()),
376  {},
377  true,
378  false,
379  false)
380  .plan_result;
381  auto result =
382  RelAlgExecutor(executor.get(), cat, query_ra).executeRelAlgQuery(co, eo, nullptr);
383  const auto& filter_push_down_requests = result.getPushedDownFilterInfo();
384  if (!filter_push_down_requests.empty()) {
385  std::vector<TFilterPushDownInfo> filter_push_down_info;
386  for (const auto& req : filter_push_down_requests) {
387  TFilterPushDownInfo filter_push_down_info_for_request;
388  filter_push_down_info_for_request.input_prev = req.input_prev;
389  filter_push_down_info_for_request.input_start = req.input_start;
390  filter_push_down_info_for_request.input_next = req.input_next;
391  filter_push_down_info.push_back(filter_push_down_info_for_request);
392  }
393  const auto new_query_ra = calcite_mgr
394  ->process(query_state_proxy,
395  pg_shim(query_state.getQueryStr()),
396  filter_push_down_info,
397  true,
398  false,
399  false)
400  .plan_result;
401  const ExecutionOptions eo_modified{eo.output_columnar_hint,
402  eo.allow_multifrag,
403  eo.just_explain,
404  eo.allow_loop_joins,
405  eo.with_watchdog,
406  eo.jit_debug,
407  eo.just_validate,
410  /*find_push_down_candidates=*/false,
411  /*just_calcite_explain=*/false,
413  return RelAlgExecutor(executor.get(), cat, new_query_ra)
414  .executeRelAlgQuery(co, eo_modified, nullptr);
415  } else {
416  return result;
417  }
418 }
static std::shared_ptr< Executor > getExecutor(const int db_id, const std::string &debug_dir="", const std::string &debug_file="", const MapDParameters mapd_parameters=MapDParameters())
Definition: Execute.cpp:127
bool g_enable_columnar_output
Definition: Execute.cpp:86
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:44
const bool output_columnar_hint
const bool allow_loop_joins
const unsigned dynamic_watchdog_time_limit
std::shared_ptr< Catalog_Namespace::SessionInfo const > getConstSessionInfo() const
Definition: QueryState.cpp:77
std::string pg_shim(const std::string &query)
const bool with_watchdog

+ Here is the call graph for this function:

+ Here is the caller graph for this function: