Skip to main content

linkrs_query/optimizer/cost_based/join_order/
result.rs

1//! Result types of join order optimization.
2
3use crate::optimizer::decision::JoinAlgorithm;
4
5/// Results of the optimization of the connection sequence
6#[derive(Debug, Clone)]
7pub struct JoinOrderResult {
8    /// Optimal connection order (list of table IDs)
9    pub order: Vec<String>,
10    /// The choice of algorithm for each connection
11    pub algorithms: Vec<JoinAlgorithm>,
12    /// Total estimated cost
13    pub total_cost: f64,
14    /// Final estimated number of output lines
15    pub final_output_rows: u64,
16    /// The optimization algorithms used
17    pub optimization_method: OptimizationMethod,
18}
19
20/// Optimization methods
21#[derive(Debug, Clone, Copy, PartialEq, Eq)]
22pub enum OptimizationMethod {
23    /// Dynamic Programming
24    DynamicProgramming,
25    /// Greedy algorithm
26    Greedy,
27    /// Heuristic approach (too few examples available)
28    Heuristic,
29}