mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-03 08:24:19 +01:00
Don't do any I/O if top level operator is Nothing
This commit is contained in:
@@ -16,7 +16,13 @@ pub fn optimize_plan(mut select_plan: Plan) -> Result<Plan> {
|
||||
&mut select_plan.root_operator,
|
||||
&select_plan.referenced_tables,
|
||||
)?;
|
||||
eliminate_constants(&mut select_plan.root_operator)?;
|
||||
let viable_plan = eliminate_constants(&mut select_plan.root_operator)?;
|
||||
if !viable_plan {
|
||||
return Ok(Plan {
|
||||
root_operator: Operator::Nothing,
|
||||
referenced_tables: vec![],
|
||||
});
|
||||
}
|
||||
use_indexes(
|
||||
&mut select_plan.root_operator,
|
||||
&select_plan.referenced_tables,
|
||||
|
||||
Reference in New Issue
Block a user