OmniSciDB  1dac507f6e
 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 344 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().

350  {
351  auto const& query_state = query_state_proxy.getQueryState();
352  const auto& cat = query_state.getConstSessionInfo()->getCatalog();
353  auto executor = Executor::getExecutor(cat.getCurrentDB().dbId);
354  CompilationOptions co = {
355  device_type, true, ExecutorOptLevel::LoopStrengthReduction, false};
357  true,
358  just_explain,
359  allow_loop_joins,
360  false,
361  false,
362  false,
363  false,
364  10000,
365  with_filter_push_down,
366  false,
368  auto calcite_mgr = cat.getCalciteMgr();
369  const auto query_ra = calcite_mgr
370  ->process(query_state_proxy,
371  pg_shim(query_state.getQueryStr()),
372  {},
373  true,
374  false,
375  false)
376  .plan_result;
377  RelAlgExecutor ra_executor(executor.get(), cat);
378 
379  auto result = ra_executor.executeRelAlgQuery(query_ra, co, eo, nullptr);
380  const auto& filter_push_down_requests = result.getPushedDownFilterInfo();
381  if (!filter_push_down_requests.empty()) {
382  std::vector<TFilterPushDownInfo> filter_push_down_info;
383  for (const auto& req : filter_push_down_requests) {
384  TFilterPushDownInfo filter_push_down_info_for_request;
385  filter_push_down_info_for_request.input_prev = req.input_prev;
386  filter_push_down_info_for_request.input_start = req.input_start;
387  filter_push_down_info_for_request.input_next = req.input_next;
388  filter_push_down_info.push_back(filter_push_down_info_for_request);
389  }
390  const auto new_query_ra = calcite_mgr
391  ->process(query_state_proxy,
392  pg_shim(query_state.getQueryStr()),
393  filter_push_down_info,
394  true,
395  false,
396  false)
397  .plan_result;
398  const ExecutionOptions eo_modified{eo.output_columnar_hint,
399  eo.allow_multifrag,
400  eo.just_explain,
401  eo.allow_loop_joins,
402  eo.with_watchdog,
403  eo.jit_debug,
404  eo.just_validate,
407  /*find_push_down_candidates=*/false,
408  /*just_calcite_explain=*/false,
410  return ra_executor.executeRelAlgQuery(new_query_ra, co, eo_modified, nullptr);
411  } else {
412  return result;
413  }
414 }
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(),::QueryRenderer::QueryRenderManager *render_manager=nullptr)
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:75
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: