(&mut self, expr: HirRelationExpr)
| 165 | type To = LocalMirPlan; |
| 166 | |
| 167 | fn optimize(&mut self, expr: HirRelationExpr) -> Result<Self::To, OptimizerError> { |
| 168 | let time = Instant::now(); |
| 169 | |
| 170 | // Trace the pipeline input under `optimize/raw`. |
| 171 | trace_plan!(at: "raw", &expr); |
| 172 | |
| 173 | // HIR ⇒ MIR lowering and decorrelation |
| 174 | let mir_expr = expr.clone().lower(&self.config, Some(&self.metrics))?; |
| 175 | |
| 176 | // MIR ⇒ MIR optimization (local) |
| 177 | let mut df_meta = DataflowMetainfo::default(); |
| 178 | let mut transform_ctx = TransformCtx::local( |
| 179 | &self.config.features, |
| 180 | &self.typecheck_ctx, |
| 181 | &mut df_meta, |
| 182 | Some(&mut self.metrics), |
| 183 | Some(self.view_id), |
| 184 | ); |
| 185 | let mir_expr = optimize_mir_local(mir_expr, &mut transform_ctx)?.into_inner(); |
| 186 | let typ = infer_sql_type_for_catalog(&expr, &mir_expr); |
| 187 | |
| 188 | self.duration += time.elapsed(); |
| 189 | |
| 190 | // Return the (sealed) plan at the end of this optimization step. |
| 191 | Ok(LocalMirPlan { |
| 192 | expr: mir_expr, |
| 193 | df_meta, |
| 194 | typ, |
| 195 | }) |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | impl LocalMirPlan { |
nothing calls this directly
no test coverage detected