Skip to content

Commit

Permalink
explain: remove Filter layer from OptimizerTrace stack
Browse files Browse the repository at this point in the history
It's not clear why we need this, and it might be causing a regression
in our optimization times.
  • Loading branch information
aalexandrov committed Apr 19, 2024
1 parent 81a2c78 commit 4b2e5d2
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/adapter/src/explain/optimizer_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,7 @@ impl OptimizerTrace {
.with(PlanTrace::<DataflowDescription<Plan>>::new(filter()))
// Don't filter for FastPathPlan entries (there can be at most one).
.with(PlanTrace::<FastPathPlan>::new(None))
.with(PlanTrace::<UsedIndexes>::new(None))
// All optimizer spans are `TRACE` and up. Technically this slows down the system
// by skipping the tracing fast path DURING an `EXPLAIN`, but we haven't
// seen this be a problem (yet).
//
// Note that we typically do NOT use global filters like this, preferring
// per-layer ones, but we are forced to because per-layer filters
// require an `Arc<dyn Subscriber + LookupSpan>`, which isn't a trait
// exposed by tracing, for now.
.with(tracing::level_filters::LevelFilter::TRACE);
.with(PlanTrace::<UsedIndexes>::new(None));

OptimizerTrace(dispatcher::Dispatch::new(subscriber))
} else {
Expand All @@ -103,8 +94,7 @@ impl OptimizerTrace {
.with(PlanTrace::<DataflowDescription<OptimizedMirRelationExpr>>::new(filter()))
.with(PlanTrace::<DataflowDescription<Plan>>::new(filter()))
.with(PlanTrace::<FastPathPlan>::new(None))
.with(PlanTrace::<UsedIndexes>::new(None))
.with(tracing::level_filters::LevelFilter::TRACE);
.with(PlanTrace::<UsedIndexes>::new(None));

OptimizerTrace(dispatcher::Dispatch::new(subscriber))
}
Expand Down

0 comments on commit 4b2e5d2

Please sign in to comment.