Skip to content

Commit

Permalink
reduce the locking range in metrics_to_string.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Sep 11, 2023
1 parent f9e5d0c commit f928b26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions query_engine/src/datafusion_impl/physical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ impl PhysicalPlan for DataFusionPhysicalPlanAdapter {
}

fn metrics_to_string(&self) -> String {
let executed_opt = &*self.executed_plan.read().unwrap();
let executed_opt = { self.executed_plan.read().unwrap().clone() };

match executed_opt {
Some(plan) => DisplayableExecutionPlan::with_metrics(plan.as_ref())
.indent(true)
.to_string(),
None => "Plan is not executed yet".to_string(),
None => "plan is not executed yet".to_string(),
}
}
}

0 comments on commit f928b26

Please sign in to comment.