hawdb_optimizer_graph/
trace.rs1use crate::cost::{PlanCost, PlanCostBreakdown};
16use crate::properties::PhysicalProperties;
17use crate::search::{RuleEvent, SearchMode};
18use crate::stage::StageTrace;
19use hawdb_plan_cypher::{PhysicalOperatorId, PhysicalPlanKind};
20use std::collections::BTreeMap;
21
22pub use hawdb_cascades::OptimizerConfig;
23
24#[derive(Debug, Clone, PartialEq, Eq)]
25pub struct OptimizerTrace {
26 pub groups: usize,
27 pub search_mode: SearchMode,
28 pub query_digest: Option<String>,
29 pub selected_plan: String,
30 pub selected_plan_fingerprint: String,
32 pub selected_plan_cost: PlanCost,
33 pub selected_plan_cost_breakdown: PlanCostBreakdown,
34 pub selected_plan_properties: PhysicalProperties,
35 pub selected_plan_cardinality_estimates: Vec<OperatorCardinalityEstimate>,
37 pub selected_plan_operator_counts: BTreeMap<String, usize>,
38 pub selected_plan_class_counts: BTreeMap<String, usize>,
39 pub warnings: Vec<String>,
40 pub decisions: Vec<String>,
41 pub rule_events: Vec<RuleEvent>,
42 pub stage_events: Vec<StageTrace>,
43}
44
45#[derive(Debug, Clone, Copy, PartialEq, Eq)]
47pub struct OperatorCardinalityEstimate {
48 pub operator_id: PhysicalOperatorId,
49 pub operator: PhysicalPlanKind,
50 pub estimated_rows: u64,
51}