Skip to content

Commit d70bb75

Browse files
authored
feat: support dynamic programming for join reorder (#10696)
* feat: support dynamic programming for join reorder * define methods in dphyp algo * continue tomorrow * add copywrite * finish create edge for graph * update * update recursive * start to debug * fix build * fix lint * update * fix some bugs * join order is correct * adjust relation * add join condition to neighbor info * finish * update * fix cost
1 parent d979430 commit d70bb75

File tree

12 files changed

+891
-2
lines changed

12 files changed

+891
-2
lines changed

src/query/service/tests/it/storages/testdata/settings_table.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ DB.Table: 'system'.'settings', Table: settings-table_id:1, ver:0, Engine: System
88
| "enable_bushy_join" | "0" | "0" | "SESSION" | "Enables generating a bushy join plan with the optimizer." | "UInt64" |
99
| "enable_cbo" | "1" | "1" | "SESSION" | "Enables cost-based optimization." | "UInt64" |
1010
| "enable_distributed_eval_index" | "1" | "1" | "SESSION" | "Enables evaluated indexes to be created and maintained across multiple nodes." | "UInt64" |
11+
| "enable_dphyp" | "0" | "0" | "SESSION" | "Enables dphyp join order algorithm." | "UInt64" |
1112
| "enable_query_result_cache" | "0" | "0" | "SESSION" | "Enables caching query results to improve performance for identical queries." | "UInt64" |
1213
| "enable_runtime_filter" | "0" | "0" | "SESSION" | "Enables runtime filter optimization for JOIN." | "UInt64" |
1314
| "flight_client_timeout" | "60" | "60" | "SESSION" | "Sets the maximum time in seconds that a flight client request can be processed." | "UInt64" |

src/query/settings/src/settings_default.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ impl DefaultSettings {
125125
desc: "Sets the SQL dialect. Available values include \"PostgreSQL\", \"MySQL\", and \"Hive\".",
126126
possible_values: Some(vec!["PostgreSQL", "MySQL", "Hive"]),
127127
}),
128+
("enable_dphyp", DefaultSettingValue {
129+
value: UserSettingValue::UInt64(0),
130+
desc: "Enables dphyp join order algorithm.",
131+
possible_values: None,
132+
}),
128133
("enable_cbo", DefaultSettingValue {
129134
value: UserSettingValue::UInt64(1),
130135
desc: "Enables cost-based optimization.",

src/query/settings/src/settings_getter_setter.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ impl Settings {
217217
self.try_set_u64("enable_distributed_eval_index", u64::from(val))
218218
}
219219

220+
pub fn get_enable_dphyp(&self) -> Result<bool> {
221+
Ok(self.try_get_u64("enable_dphyp")? != 0)
222+
}
223+
224+
pub fn set_enable_dphyp(&self, val: bool) -> Result<()> {
225+
self.try_set_u64("enable_dphyp", u64::from(val))
226+
}
227+
220228
pub fn get_enable_cbo(&self) -> Result<bool> {
221229
Ok(self.try_get_u64("enable_cbo")? != 0)
222230
}

0 commit comments

Comments
 (0)