-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
35 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,4 @@ | ||
use tracing::span; | ||
|
||
use crate::planner::logical_plan::LogicalPlan; | ||
|
||
use self::{physical_optimizer::PhysicalOptimizer, physical_plan::PhysicalPlan}; | ||
|
||
mod logical_optimizer; | ||
pub mod physical_optimizer; | ||
pub mod physical_plan; | ||
mod rule; | ||
|
||
pub use logical_optimizer::{LogicalOptimizer, LogicalOptimizerRule}; | ||
|
||
pub struct Optimizer { | ||
physical_optimizer: PhysicalOptimizer, | ||
} | ||
impl Optimizer { | ||
pub fn new() -> Self { | ||
Self { | ||
physical_optimizer: PhysicalOptimizer {}, | ||
} | ||
} | ||
|
||
pub fn find_best(&mut self, logical_plan: LogicalPlan) -> PhysicalPlan { | ||
let _find_best_span = span!(tracing::Level::INFO, "optimizer.find_best").entered(); | ||
// TODO optimize logical plan | ||
|
||
// optimize physical plan | ||
self.physical_optimizer.find_best(logical_plan) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod push_down_limit; | ||
|
||
pub use push_down_limit::PushDownLimit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use crate::error::BustubxResult; | ||
use crate::optimizer::LogicalOptimizerRule; | ||
use crate::planner::logical_plan::LogicalPlan; | ||
|
||
pub struct PushDownLimit; | ||
|
||
impl LogicalOptimizerRule for PushDownLimit { | ||
fn try_optimize(&self, plan: &LogicalPlan) -> BustubxResult<Option<LogicalPlan>> { | ||
todo!() | ||
} | ||
|
||
fn name(&self) -> &str { | ||
"PushDownLimit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters