OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelAlgDag Class Reference

#include <RelAlgDag.h>

+ Inheritance diagram for RelAlgDag:
+ Collaboration diagram for RelAlgDag:

Public Types

enum  BuildState { BuildState::kNotBuilt, BuildState::kBuiltNotOptimized, BuildState::kBuiltOptimized }
 

Public Member Functions

 RelAlgDag ()
 
BuildState getBuildState () const
 
void eachNode (std::function< void(RelAlgNode const *)> const &) const
 
const RelAlgNodegetRootNode () const
 
std::shared_ptr< const RelAlgNodegetRootNodeShPtr () const
 
void registerSubquery (std::shared_ptr< RexSubQuery > subquery)
 
const std::vector
< std::shared_ptr< RexSubQuery > > & 
getSubqueries () const
 
void registerQueryHints (std::shared_ptr< RelAlgNode > node, Hints *hints_delivered, RegisteredQueryHint &global_query_hint)
 
void registerQueryHint (const RelAlgNode *node, const RegisteredQueryHint &query_hint)
 
std::optional
< RegisteredQueryHint
getQueryHint (const RelAlgNode *node) const
 
std::unordered_map< size_t,
std::unordered_map< unsigned,
RegisteredQueryHint > > & 
getQueryHints ()
 
const RegisteredQueryHintgetGlobalHints () const
 
void setGlobalQueryHints (const RegisteredQueryHint &global_hints)
 
void resetQueryExecutionState ()
 

Private Attributes

BuildState build_state_
 
std::vector< std::shared_ptr
< RelAlgNode > > 
nodes_
 
std::vector< std::shared_ptr
< RexSubQuery > > 
subqueries_
 
std::unordered_map< size_t,
std::unordered_map< unsigned,
RegisteredQueryHint > > 
query_hint_
 
RegisteredQueryHint global_hints_
 

Friends

struct RelAlgDagSerializer
 
struct RelAlgDagModifier
 

Detailed Description

Class defining an in-memory, easy-to-navigate internal representation of a relational algebra DAG interpreted from a JSON provided by Calcite. Must be built through the RelAlgDagBuilder interface.

Definition at line 2501 of file RelAlgDag.h.

Member Enumeration Documentation

enum RelAlgDag::BuildState
strong
Enumerator
kNotBuilt 
kBuiltNotOptimized 
kBuiltOptimized 

Definition at line 2503 of file RelAlgDag.h.

2503 { kNotBuilt, kBuiltNotOptimized, kBuiltOptimized };

Constructor & Destructor Documentation

RelAlgDag::RelAlgDag ( )
inline

Definition at line 2505 of file RelAlgDag.h.

References kNotBuilt.

Member Function Documentation

void RelAlgDag::eachNode ( std::function< void(RelAlgNode const *)> const &  callback) const

Definition at line 3340 of file RelAlgDag.cpp.

References nodes_.

3340  {
3341  for (auto const& node : nodes_) {
3342  if (node) {
3343  callback(node.get());
3344  }
3345  }
3346 }
std::vector< std::shared_ptr< RelAlgNode > > nodes_
Definition: RelAlgDag.h:2986
BuildState RelAlgDag::getBuildState ( ) const
inline

Definition at line 2507 of file RelAlgDag.h.

References build_state_.

Referenced by RelAlgDagBuilder::optimizeDag().

2507 { return build_state_; }
BuildState build_state_
Definition: RelAlgDag.h:2984

+ Here is the caller graph for this function:

const RegisteredQueryHint& RelAlgDag::getGlobalHints ( ) const
inline

Definition at line 2972 of file RelAlgDag.h.

References global_hints_.

Referenced by anonymous_namespace{RelAlgDag.cpp}::parse_subquery().

2972 { return global_hints_; }
RegisteredQueryHint global_hints_
Definition: RelAlgDag.h:2994

+ Here is the caller graph for this function:

std::optional<RegisteredQueryHint> RelAlgDag::getQueryHint ( const RelAlgNode node) const
inline

Definition at line 2944 of file RelAlgDag.h.

References RelAlgNode::getId(), global_hints_, RegisteredQueryHint::isAnyQueryHintDelivered(), query_hint_, and RelAlgNode::toHash().

2944  {
2945  auto node_it = query_hint_.find(node->toHash());
2946  if (node_it != query_hint_.end()) {
2947  auto const& registered_query_hint_map = node_it->second;
2948  auto hint_it = registered_query_hint_map.find(node->getId());
2949  if (hint_it != registered_query_hint_map.end()) {
2950  auto const& registered_query_hint = hint_it->second;
2952  // apply global hint to the registered query hint for this query block
2953  return std::make_optional(registered_query_hint || global_hints_);
2954  } else {
2955  return std::make_optional(registered_query_hint);
2956  }
2957  }
2958  }
2960  // if no hint is registered from this query block
2961  // we return global hint instead
2962  return std::make_optional(global_hints_);
2963  }
2964  return std::nullopt;
2965  }
std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint > > query_hint_
Definition: RelAlgDag.h:2993
unsigned getId() const
Definition: RelAlgDag.h:880
RegisteredQueryHint global_hints_
Definition: RelAlgDag.h:2994
virtual size_t toHash() const =0
bool isAnyQueryHintDelivered() const
Definition: QueryHint.h:338

+ Here is the call graph for this function:

std::unordered_map<size_t, std::unordered_map<unsigned, RegisteredQueryHint> >& RelAlgDag::getQueryHints ( )
inline

Definition at line 2968 of file RelAlgDag.h.

References query_hint_.

2968  {
2969  return query_hint_;
2970  }
std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint > > query_hint_
Definition: RelAlgDag.h:2993
const RelAlgNode& RelAlgDag::getRootNode ( ) const
inline

Returns the root node of the DAG.

Definition at line 2514 of file RelAlgDag.h.

References CHECK, and nodes_.

2514  {
2515  CHECK(nodes_.size());
2516  const auto& last_ptr = nodes_.back();
2517  CHECK(last_ptr);
2518  return *last_ptr;
2519  }
std::vector< std::shared_ptr< RelAlgNode > > nodes_
Definition: RelAlgDag.h:2986
#define CHECK(condition)
Definition: Logger.h:291
std::shared_ptr<const RelAlgNode> RelAlgDag::getRootNodeShPtr ( ) const
inline

Definition at line 2521 of file RelAlgDag.h.

References CHECK, and nodes_.

2521  {
2522  CHECK(nodes_.size());
2523  return nodes_.back();
2524  }
std::vector< std::shared_ptr< RelAlgNode > > nodes_
Definition: RelAlgDag.h:2986
#define CHECK(condition)
Definition: Logger.h:291
const std::vector<std::shared_ptr<RexSubQuery> >& RelAlgDag::getSubqueries ( ) const
inline

Gets all registered subqueries. Only the root DAG can contain subqueries.

Definition at line 2537 of file RelAlgDag.h.

References subqueries_.

2537  {
2538  return subqueries_;
2539  }
std::vector< std::shared_ptr< RexSubQuery > > subqueries_
Definition: RelAlgDag.h:2987
void RelAlgDag::registerQueryHint ( const RelAlgNode node,
const RegisteredQueryHint query_hint 
)
inline

Definition at line 2932 of file RelAlgDag.h.

References RelAlgNode::getId(), query_hint_, and RelAlgNode::toHash().

Referenced by anonymous_namespace{RelAlgDag.cpp}::parse_subquery(), and registerQueryHints().

2932  {
2933  auto node_key = node->toHash();
2934  auto it = query_hint_.find(node_key);
2935  if (it == query_hint_.end()) {
2936  std::unordered_map<unsigned, RegisteredQueryHint> hint_map;
2937  hint_map.emplace(node->getId(), query_hint);
2938  query_hint_.emplace(node_key, hint_map);
2939  } else {
2940  it->second.emplace(node->getId(), query_hint);
2941  }
2942  }
std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint > > query_hint_
Definition: RelAlgDag.h:2993
unsigned getId() const
Definition: RelAlgDag.h:880
virtual size_t toHash() const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RelAlgDag::registerQueryHints ( std::shared_ptr< RelAlgNode node,
Hints hints_delivered,
RegisteredQueryHint global_query_hint 
)
inline

Definition at line 2542 of file RelAlgDag.h.

References RegisteredQueryHint::aggregate_tree_fanout, CHECK_EQ, RegisteredQueryHint::columnar_output, RegisteredQueryHint::cpu_mode, RegisteredQueryHint::cuda_block_size, RegisteredQueryHint::cuda_grid_size_multiplier, RegisteredQueryHint::dynamic_watchdog, g_enable_columnar_output, g_enable_data_recycler, g_enable_dynamic_watchdog, g_enable_watchdog, g_use_query_resultset_cache, kAggregateTreeFanout, kAllowLoopJoin, kColumnarOutput, kCpuMode, kCudaBlockSize, kCudaGridSize, kDisableLoopJoin, kDynamicWatchdog, kDynamicWatchdogOff, RegisteredQueryHint::keep_result, RegisteredQueryHint::keep_table_function_result, kKeepResult, kKeepTableFuncResult, kLoopJoinInnerTableMaxNumRows, kMaxJoinHashTableSize, kOptCudaBlockAndGridSizes, kOverlapsAllowGpuBuild, kOverlapsBucketThreshold, kOverlapsKeysPerBin, kOverlapsMaxSize, kOverlapsNoCache, kQueryTimeLimit, kRowwiseOutput, kWatchdog, kWatchdogOff, RegisteredQueryHint::loop_join_inner_table_max_num_rows, RegisteredQueryHint::max_join_hash_table_size, RegisteredQueryHint::opt_cuda_grid_and_block_size, RegisteredQueryHint::overlaps_allow_gpu_build, RegisteredQueryHint::overlaps_bucket_threshold, RegisteredQueryHint::overlaps_keys_per_bin, RegisteredQueryHint::overlaps_max_size, RegisteredQueryHint::overlaps_no_cache, RegisteredQueryHint::query_time_limit, RegisteredQueryHint::registerHint(), registerQueryHint(), RegisteredQueryHint::rowwise_output, RegisteredQueryHint::use_loop_join, VLOG, and RegisteredQueryHint::watchdog.

2544  {
2545  std::optional<bool> has_global_columnar_output_hint = std::nullopt;
2546  std::optional<bool> has_global_rowwise_output_hint = std::nullopt;
2547  RegisteredQueryHint query_hint;
2548  for (auto it = hints_delivered->begin(); it != hints_delivered->end(); it++) {
2549  auto target = it->second;
2550  auto hint_type = it->first;
2551  switch (hint_type) {
2552  case QueryHint::kCpuMode: {
2553  query_hint.registerHint(QueryHint::kCpuMode);
2554  query_hint.cpu_mode = true;
2555  if (target.isGlobalHint()) {
2556  global_query_hint.registerHint(QueryHint::kCpuMode);
2557  global_query_hint.cpu_mode = true;
2558  }
2559  break;
2560  }
2562  has_global_columnar_output_hint = target.isGlobalHint();
2563  break;
2564  }
2566  has_global_rowwise_output_hint = target.isGlobalHint();
2567  break;
2568  }
2570  if (target.getListOptions().size() != 1) {
2571  VLOG(1) << "Skip the given query hint \"overlaps_bucket_threshold\" ("
2572  << target.getListOptions()[0]
2573  << ") : invalid # hint options are given";
2574  break;
2575  }
2576  double overlaps_bucket_threshold = std::stod(target.getListOptions()[0]);
2577  if (overlaps_bucket_threshold >= 0.0 && overlaps_bucket_threshold <= 90.0) {
2579  query_hint.overlaps_bucket_threshold = overlaps_bucket_threshold;
2580  if (target.isGlobalHint()) {
2582  global_query_hint.overlaps_bucket_threshold = overlaps_bucket_threshold;
2583  }
2584  } else {
2585  VLOG(1) << "Skip the given query hint \"overlaps_bucket_threshold\" ("
2586  << overlaps_bucket_threshold
2587  << ") : the hint value should be within 0.0 ~ 90.0";
2588  }
2589  break;
2590  }
2592  if (target.getListOptions().size() != 1) {
2593  VLOG(1) << "Skip the given query hint \"overlaps_max_size\" ("
2594  << target.getListOptions()[0]
2595  << ") : invalid # hint options are given";
2596  break;
2597  }
2598  std::stringstream ss(target.getListOptions()[0]);
2599  int overlaps_max_size;
2600  ss >> overlaps_max_size;
2601  if (overlaps_max_size >= 0) {
2603  query_hint.overlaps_max_size = (size_t)overlaps_max_size;
2604  if (target.isGlobalHint()) {
2605  global_query_hint.registerHint(QueryHint::kOverlapsMaxSize);
2606  global_query_hint.overlaps_max_size = (size_t)overlaps_max_size;
2607  }
2608  } else {
2609  VLOG(1) << "Skip the query hint \"overlaps_max_size\" (" << overlaps_max_size
2610  << ") : the hint value should be larger than or equal to zero";
2611  }
2612  break;
2613  }
2616  query_hint.overlaps_allow_gpu_build = true;
2617  if (target.isGlobalHint()) {
2619  global_query_hint.overlaps_allow_gpu_build = true;
2620  }
2621  break;
2622  }
2625  query_hint.overlaps_no_cache = true;
2626  if (target.isGlobalHint()) {
2627  global_query_hint.registerHint(QueryHint::kOverlapsNoCache);
2628  global_query_hint.overlaps_no_cache = true;
2629  }
2630  VLOG(1) << "Skip auto tuner and hashtable caching for overlaps join.";
2631  break;
2632  }
2634  if (target.getListOptions().size() != 1) {
2635  VLOG(1) << "Skip the given query hint \"overlaps_keys_per_bin\" ("
2636  << target.getListOptions()[0]
2637  << ") : invalid # hint options are given";
2638  break;
2639  }
2640  double overlaps_keys_per_bin = std::stod(target.getListOptions()[0]);
2641  if (overlaps_keys_per_bin > 0.0 &&
2642  overlaps_keys_per_bin < std::numeric_limits<double>::max()) {
2644  query_hint.overlaps_keys_per_bin = overlaps_keys_per_bin;
2645  if (target.isGlobalHint()) {
2646  global_query_hint.registerHint(QueryHint::kOverlapsKeysPerBin);
2647  global_query_hint.overlaps_keys_per_bin = overlaps_keys_per_bin;
2648  }
2649  } else {
2650  VLOG(1) << "Skip the given query hint \"overlaps_keys_per_bin\" ("
2651  << overlaps_keys_per_bin
2652  << ") : the hint value should be larger than zero";
2653  }
2654  break;
2655  }
2656  case QueryHint::kKeepResult: {
2658  VLOG(1) << "Skip query hint \'keep_result\' because neither data recycler "
2659  "nor query resultset recycler is enabled";
2660  } else {
2662  query_hint.keep_result = true;
2663  if (target.isGlobalHint()) {
2664  global_query_hint.registerHint(QueryHint::kKeepResult);
2665  global_query_hint.keep_result = true;
2666  }
2667  }
2668  break;
2669  }
2672  VLOG(1) << "Skip query hint \'keep_table_function_result\' because neither "
2673  "data recycler "
2674  "nor query resultset recycler is enabled";
2675  } else {
2676  // we assume table function's hint is handled as global hint by default
2677  global_query_hint.registerHint(QueryHint::kKeepTableFuncResult);
2678  global_query_hint.keep_table_function_result = true;
2679  }
2680  break;
2681  }
2683  if (target.getListOptions().size() != 1u) {
2684  VLOG(1) << "Skip the given query hint \"aggregate_tree_fanout\" ("
2685  << target.getListOptions()[0]
2686  << ") : invalid # hint options are given";
2687  break;
2688  }
2689  int aggregate_tree_fanout = std::stoi(target.getListOptions()[0]);
2690  if (aggregate_tree_fanout < 0) {
2691  VLOG(1) << "A fan-out of an aggregate tree should be larger than zero";
2692  } else if (aggregate_tree_fanout > 1024) {
2693  VLOG(1) << "Too large fanout is provided (i.e., fanout < 1024)";
2694  } else {
2696  query_hint.aggregate_tree_fanout = aggregate_tree_fanout;
2697  if (target.isGlobalHint()) {
2698  global_query_hint.registerHint(QueryHint::kAggregateTreeFanout);
2699  global_query_hint.aggregate_tree_fanout = aggregate_tree_fanout;
2700  }
2701  }
2702  break;
2703  }
2705  CHECK_EQ(1u, target.getListOptions().size());
2706  int cuda_block_size = std::stoi(target.getListOptions()[0]);
2707  if (cuda_block_size <= 0) {
2708  VLOG(1) << "CUDA block size should be larger than zero";
2709  } else if (cuda_block_size > 1024) {
2710  VLOG(1) << "CUDA block size should be less or equal to 1024";
2711  } else {
2713  query_hint.cuda_block_size = cuda_block_size;
2714  if (target.isGlobalHint()) {
2715  global_query_hint.registerHint(QueryHint::kCudaBlockSize);
2716  global_query_hint.cuda_block_size = cuda_block_size;
2717  }
2718  }
2719  break;
2720  }
2721  case QueryHint::kCudaGridSize: {
2722  CHECK_EQ(1u, target.getListOptions().size());
2723  double cuda_grid_size_multiplier = std::stod(target.getListOptions()[0]);
2724  double min_grid_size_multiplier{0};
2725  double max_grid_size_multiplier{1024};
2726  if (cuda_grid_size_multiplier <= min_grid_size_multiplier) {
2727  VLOG(1) << "CUDA grid size multiplier should be larger than zero";
2728  } else if (cuda_grid_size_multiplier > max_grid_size_multiplier) {
2729  VLOG(1) << "CUDA grid size multiplier should be less than 1024";
2730  } else {
2732  query_hint.cuda_grid_size_multiplier = cuda_grid_size_multiplier;
2733  if (target.isGlobalHint()) {
2734  global_query_hint.registerHint(QueryHint::kCudaGridSize);
2735  global_query_hint.cuda_grid_size_multiplier = cuda_grid_size_multiplier;
2736  }
2737  }
2738  break;
2739  }
2742  query_hint.opt_cuda_grid_and_block_size = true;
2743  if (target.isGlobalHint()) {
2745  global_query_hint.opt_cuda_grid_and_block_size = true;
2746  }
2747  break;
2748  }
2749  case QueryHint::kWatchdog: {
2750  if (g_enable_watchdog) {
2751  VLOG(1) << "Skip the given query hint \"watchdog\": already enabled";
2752  } else {
2753  query_hint.registerHint(QueryHint::kWatchdog);
2754  query_hint.watchdog = true;
2755  if (target.isGlobalHint()) {
2756  global_query_hint.registerHint(QueryHint::kWatchdog);
2757  global_query_hint.watchdog = true;
2758  }
2759  }
2760  break;
2761  }
2762  case QueryHint::kWatchdogOff: {
2763  if (!g_enable_watchdog) {
2764  VLOG(1) << "Skip the given query hint \"watchdog_off\": already disabled";
2765  } else {
2767  query_hint.watchdog = false;
2768  if (target.isGlobalHint()) {
2769  global_query_hint.registerHint(QueryHint::kWatchdogOff);
2770  global_query_hint.watchdog = false;
2771  }
2772  }
2773 
2774  break;
2775  }
2778  VLOG(1) << "Skip the given query hint \"dynamic_watchdog\": already enabled";
2779  } else {
2781  query_hint.dynamic_watchdog = true;
2782  if (target.isGlobalHint()) {
2783  global_query_hint.registerHint(QueryHint::kDynamicWatchdog);
2784  global_query_hint.dynamic_watchdog = true;
2785  }
2786  }
2787  break;
2788  }
2791  VLOG(1)
2792  << "Skip the given query hint \"dynamic_watchdog_off\": already disabled";
2793  } else {
2795  query_hint.dynamic_watchdog = false;
2796  if (target.isGlobalHint()) {
2797  global_query_hint.registerHint(QueryHint::kDynamicWatchdogOff);
2798  global_query_hint.dynamic_watchdog = false;
2799  }
2800  }
2801  break;
2802  }
2804  if (hints_delivered->find(QueryHint::kDynamicWatchdogOff) !=
2805  hints_delivered->end()) {
2806  VLOG(1) << "Skip the given query hint \"query_time_limit\" ("
2807  << target.getListOptions()[0]
2808  << ") : cannot use it with \"dynamic_watchdog_off\" hint";
2809  break;
2810  }
2811  if (target.getListOptions().size() != 1) {
2812  VLOG(1) << "Skip the given query hint \"query_time_limit\" ("
2813  << target.getListOptions()[0]
2814  << ") : invalid # hint options are given";
2815  break;
2816  }
2817  double query_time_limit = std::stoi(target.getListOptions()[0]);
2818  if (query_time_limit <= 0) {
2819  VLOG(1) << "Skip the given query hint \"query_time_limit\" ("
2820  << target.getListOptions()[0]
2821  << ") : the hint value should be larger than zero";
2822  break;
2823  }
2825  query_hint.query_time_limit = query_time_limit;
2826  if (target.isGlobalHint()) {
2827  global_query_hint.registerHint(QueryHint::kQueryTimeLimit);
2828  global_query_hint.query_time_limit = query_time_limit;
2829  }
2830  break;
2831  }
2834  query_hint.use_loop_join = true;
2835  if (target.isGlobalHint()) {
2836  global_query_hint.registerHint(QueryHint::kAllowLoopJoin);
2837  global_query_hint.use_loop_join = true;
2838  }
2839  break;
2840  }
2843  query_hint.use_loop_join = false;
2844  if (target.isGlobalHint()) {
2845  global_query_hint.registerHint(QueryHint::kDisableLoopJoin);
2846  global_query_hint.use_loop_join = false;
2847  }
2848  break;
2849  }
2851  CHECK_EQ(1u, target.getListOptions().size());
2852  int loop_size_threshold = std::stoi(target.getListOptions()[0]);
2853  if (loop_size_threshold <= 0) {
2854  VLOG(1) << "The loop size threshold should be larger than zero";
2855  } else {
2857  query_hint.loop_join_inner_table_max_num_rows = loop_size_threshold;
2858  if (target.isGlobalHint()) {
2860  global_query_hint.loop_join_inner_table_max_num_rows = loop_size_threshold;
2861  }
2862  }
2863  break;
2864  }
2866  CHECK_EQ(1u, target.getListOptions().size());
2867  int max_join_hash_table_size = std::stoi(target.getListOptions()[0]);
2868  if (max_join_hash_table_size <= 0) {
2869  VLOG(1) << "The maximum hash table size should be larger than zero";
2870  } else {
2872  query_hint.max_join_hash_table_size = max_join_hash_table_size;
2873  if (target.isGlobalHint()) {
2875  global_query_hint.max_join_hash_table_size = max_join_hash_table_size;
2876  }
2877  }
2878  break;
2879  }
2880  default:
2881  break;
2882  }
2883  }
2884  // we have four cases depending on 1) g_enable_columnar_output flag
2885  // and 2) query hint status: columnar_output and rowwise_output
2886  // case 1. g_enable_columnar_output = true
2887  // case 1.a) columnar_output = true (so rowwise_output = false);
2888  // case 1.b) rowwise_output = true (so columnar_output = false);
2889  // case 2. g_enable_columnar_output = false
2890  // case 2.a) columnar_output = true (so rowwise_output = false);
2891  // case 2.b) rowwise_output = true (so columnar_output = false);
2892  // case 1.a --> use columnar output
2893  // case 1.b --> use rowwise output
2894  // case 2.a --> use columnar output
2895  // case 2.b --> use rowwise output
2896  if (has_global_columnar_output_hint.has_value() &&
2897  has_global_rowwise_output_hint.has_value()) {
2898  VLOG(1)
2899  << "Two hints 1) columnar output and 2) rowwise output are enabled together, "
2900  << "so skip them and use the runtime configuration "
2901  "\"g_enable_columnar_output\"";
2902  } else if (has_global_columnar_output_hint.has_value() &&
2903  !has_global_rowwise_output_hint.has_value()) {
2905  VLOG(1) << "We already enable columnar output by default "
2906  "(g_enable_columnar_output = true), so skip this columnar output hint";
2907  } else {
2909  query_hint.columnar_output = true;
2910  if (*has_global_columnar_output_hint) {
2911  global_query_hint.registerHint(QueryHint::kColumnarOutput);
2912  global_query_hint.columnar_output = true;
2913  }
2914  }
2915  } else if (!has_global_columnar_output_hint.has_value() &&
2916  has_global_rowwise_output_hint.has_value()) {
2917  if (!g_enable_columnar_output) {
2918  VLOG(1) << "We already use the default rowwise output (g_enable_columnar_output "
2919  "= false), so skip this rowwise output hint";
2920  } else {
2922  query_hint.rowwise_output = true;
2923  if (*has_global_rowwise_output_hint) {
2924  global_query_hint.registerHint(QueryHint::kRowwiseOutput);
2925  global_query_hint.rowwise_output = true;
2926  }
2927  }
2928  }
2929  registerQueryHint(node.get(), query_hint);
2930  }
#define CHECK_EQ(x, y)
Definition: Logger.h:301
bool g_use_query_resultset_cache
Definition: Execute.cpp:148
bool overlaps_allow_gpu_build
Definition: QueryHint.h:318
void registerQueryHint(const RelAlgNode *node, const RegisteredQueryHint &query_hint)
Definition: RelAlgDag.h:2932
double overlaps_keys_per_bin
Definition: QueryHint.h:320
std::optional< bool > dynamic_watchdog
Definition: QueryHint.h:304
double cuda_grid_size_multiplier
Definition: QueryHint.h:309
size_t cuda_block_size
Definition: QueryHint.h:308
bool g_enable_dynamic_watchdog
Definition: Execute.cpp:80
bool g_enable_data_recycler
Definition: Execute.cpp:146
size_t max_join_hash_table_size
Definition: QueryHint.h:325
bool opt_cuda_grid_and_block_size
Definition: QueryHint.h:310
bool g_enable_columnar_output
Definition: Execute.cpp:99
bool keep_table_function_result
Definition: QueryHint.h:302
size_t query_time_limit
Definition: QueryHint.h:305
void registerHint(const QueryHint hint)
Definition: QueryHint.h:343
bool g_enable_watchdog
std::optional< bool > watchdog
Definition: QueryHint.h:303
size_t overlaps_max_size
Definition: QueryHint.h:317
std::optional< bool > use_loop_join
Definition: QueryHint.h:323
size_t loop_join_inner_table_max_num_rows
Definition: QueryHint.h:324
double overlaps_bucket_threshold
Definition: QueryHint.h:316
size_t aggregate_tree_fanout
Definition: QueryHint.h:313
#define VLOG(n)
Definition: Logger.h:387

+ Here is the call graph for this function:

void RelAlgDag::registerSubquery ( std::shared_ptr< RexSubQuery subquery)
inline

Registers a subquery with a root DAG builder. Should only be called during DAG building and registration should only occur on the root.

Definition at line 2530 of file RelAlgDag.h.

References subqueries_.

Referenced by anonymous_namespace{RelAlgDag.cpp}::parse_subquery().

2530  {
2531  subqueries_.push_back(subquery);
2532  }
std::vector< std::shared_ptr< RexSubQuery > > subqueries_
Definition: RelAlgDag.h:2987

+ Here is the caller graph for this function:

void RelAlgDag::resetQueryExecutionState ( )

Gets all registered subqueries. Only the root DAG can contain subqueries.

Definition at line 3348 of file RelAlgDag.cpp.

References nodes_.

3348  {
3349  for (auto& node : nodes_) {
3350  if (node) {
3351  node->resetQueryExecutionState();
3352  }
3353  }
3354 }
std::vector< std::shared_ptr< RelAlgNode > > nodes_
Definition: RelAlgDag.h:2986
void RelAlgDag::setGlobalQueryHints ( const RegisteredQueryHint global_hints)
inline

Definition at line 2974 of file RelAlgDag.h.

References global_hints_.

Referenced by RelAlgExecutor::executeRelAlgQueryNoRetry(), and anonymous_namespace{RelAlgDag.cpp}::parse_subquery().

2974  {
2975  global_hints_ = global_hints;
2976  }
RegisteredQueryHint global_hints_
Definition: RelAlgDag.h:2994

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagModifier
friend

Definition at line 2997 of file RelAlgDag.h.

friend struct RelAlgDagSerializer
friend

Definition at line 2996 of file RelAlgDag.h.

Member Data Documentation

BuildState RelAlgDag::build_state_
private
RegisteredQueryHint RelAlgDag::global_hints_
private
std::vector<std::shared_ptr<RelAlgNode> > RelAlgDag::nodes_
private
std::unordered_map<size_t, std::unordered_map<unsigned, RegisteredQueryHint> > RelAlgDag::query_hint_
private
std::vector<std::shared_ptr<RexSubQuery> > RelAlgDag::subqueries_
private

The documentation for this class was generated from the following files: