From 4b2e5d208ce68132d589c9d6aca1c1d422075cc0 Mon Sep 17 00:00:00 2001 From: Alexander Alexandrov Date: Wed, 17 Apr 2024 12:10:56 +0300 Subject: [PATCH] explain: remove `Filter` layer from `OptimizerTrace` stack It's not clear why we need this, and it might be causing a regression in our optimization times. --- src/adapter/src/explain/optimizer_trace.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/adapter/src/explain/optimizer_trace.rs b/src/adapter/src/explain/optimizer_trace.rs index b2ddb6a8cd5bc..f264750c15098 100644 --- a/src/adapter/src/explain/optimizer_trace.rs +++ b/src/adapter/src/explain/optimizer_trace.rs @@ -79,16 +79,7 @@ impl OptimizerTrace { .with(PlanTrace::>::new(filter())) // Don't filter for FastPathPlan entries (there can be at most one). .with(PlanTrace::::new(None)) - .with(PlanTrace::::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`, which isn't a trait - // exposed by tracing, for now. - .with(tracing::level_filters::LevelFilter::TRACE); + .with(PlanTrace::::new(None)); OptimizerTrace(dispatcher::Dispatch::new(subscriber)) } else { @@ -103,8 +94,7 @@ impl OptimizerTrace { .with(PlanTrace::>::new(filter())) .with(PlanTrace::>::new(filter())) .with(PlanTrace::::new(None)) - .with(PlanTrace::::new(None)) - .with(tracing::level_filters::LevelFilter::TRACE); + .with(PlanTrace::::new(None)); OptimizerTrace(dispatcher::Dispatch::new(subscriber)) }