diff --git a/src/compute-types/src/plan/lowering.rs b/src/compute-types/src/plan/lowering.rs index c8b9fe5356932..c677bb9885350 100644 --- a/src/compute-types/src/plan/lowering.rs +++ b/src/compute-types/src/plan/lowering.rs @@ -17,9 +17,11 @@ use mz_expr::{ MirRelationExpr, MirScalarExpr, OptimizedMirRelationExpr, TableFunc, }; use mz_ore::{assert_none, soft_assert_eq_or_log, soft_panic_or_log}; +use mz_repr::explain::ExplainConfig; use mz_repr::optimize::OptimizerFeatures; use mz_repr::GlobalId; use timely::progress::Timestamp; +use tracing::{span, Level}; use crate::dataflows::{BuildDesc, DataflowDescription, IndexImport}; use crate::plan::join::{DeltaJoinPlan, JoinPlan, LinearJoinPlan}; @@ -102,7 +104,13 @@ impl Context { let mut objects_to_build = Vec::with_capacity(desc.objects_to_build.len()); for build in desc.objects_to_build { self.debug_info.id = build.id; - let (plan, keys) = self.lower_mir_expr(&build.plan)?; + let plan = &build.plan; + let (plan, keys) = + span!(target: "optimizer", Level::INFO, "lower_mir_expr", "id" = ?build.id, "plan" = plan.explain(&ExplainConfig { + redacted: true, + ..Default::default() + }, None)) + .in_scope(|| self.lower_mir_expr(plan))?; self.arrangements.insert(Id::Global(build.id), keys); objects_to_build.push(BuildDesc { id: build.id, plan });