@@ -36,6 +36,7 @@ pub struct OptimizerContext {
3636 enable_distributed_optimization : RwLock < bool > ,
3737 enable_join_reorder : RwLock < bool > ,
3838 enable_dphyp : RwLock < bool > ,
39+ enable_experimental_common_subexpression_elimination : RwLock < bool > ,
3940 max_push_down_limit : RwLock < usize > ,
4041 planning_agg_index : RwLock < bool > ,
4142 #[ educe( Debug ( ignore) ) ]
@@ -59,6 +60,7 @@ impl OptimizerContext {
5960 enable_distributed_optimization : RwLock :: new ( false ) ,
6061 enable_join_reorder : RwLock :: new ( true ) ,
6162 enable_dphyp : RwLock :: new ( true ) ,
63+ enable_experimental_common_subexpression_elimination : RwLock :: new ( true ) ,
6264 max_push_down_limit : RwLock :: new ( 10000 ) ,
6365 sample_executor : RwLock :: new ( None ) ,
6466 planning_agg_index : RwLock :: new ( false ) ,
@@ -70,6 +72,9 @@ impl OptimizerContext {
7072 pub fn with_settings ( self : Arc < Self > , settings : & Settings ) -> Result < Arc < Self > > {
7173 self . set_enable_join_reorder ( unsafe { !settings. get_disable_join_reorder ( ) ? } ) ;
7274 * self . enable_dphyp . write ( ) = settings. get_enable_dphyp ( ) ?;
75+ * self
76+ . enable_experimental_common_subexpression_elimination
77+ . write ( ) = settings. get_enable_experimental_common_subexpression_elimination ( ) ?;
7378 * self . max_push_down_limit . write ( ) = settings. get_max_push_down_limit ( ) ?;
7479 * self . enable_trace . write ( ) = settings. get_enable_optimizer_trace ( ) ?;
7580
@@ -106,6 +111,12 @@ impl OptimizerContext {
106111 * self . enable_dphyp . read ( )
107112 }
108113
114+ pub fn get_enable_experimental_common_subexpression_elimination ( & self ) -> bool {
115+ * self
116+ . enable_experimental_common_subexpression_elimination
117+ . read ( )
118+ }
119+
109120 pub fn set_sample_executor (
110121 self : & Arc < Self > ,
111122 sample_executor : Option < Arc < dyn QueryExecutor > > ,
0 commit comments