hawdb_optimizer_relational/
relational_profile.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
22pub struct RelationalOperatorId(usize);
23
24impl RelationalOperatorId {
25 pub const fn from_plan_index(index: usize) -> Self {
26 Self(index.saturating_add(1))
27 }
28
29 pub const fn get(self) -> usize {
30 self.0
31 }
32}
33
34#[derive(Debug, Clone, Copy, PartialEq, Eq)]
35pub enum RelationalOperatorKind {
36 TableFullScan,
37 TablePointGet,
38 IndexRangeScan,
39 NestedLoopJoin,
40 NestedLoopLeftJoin,
41 IndexNestedLoopJoin,
42 IndexNestedLoopLeftJoin,
43 BatchedIndexNestedLoopJoin,
44 BatchedIndexNestedLoopLeftJoin,
45 MergeJoin,
46 HashJoin,
47}
48
49impl RelationalOperatorKind {
50 pub const fn as_str(self) -> &'static str {
51 match self {
52 Self::TableFullScan => "TableFullScanExec",
53 Self::TablePointGet => "TablePointGetExec",
54 Self::IndexRangeScan => "IndexRangeScanExec",
55 Self::NestedLoopJoin => "NestedLoopJoinExec",
56 Self::NestedLoopLeftJoin => "NestedLoopLeftJoinExec",
57 Self::IndexNestedLoopJoin => "IndexNestedLoopJoinExec",
58 Self::IndexNestedLoopLeftJoin => "IndexNestedLoopLeftJoinExec",
59 Self::BatchedIndexNestedLoopJoin => "BatchedIndexNestedLoopJoinExec",
60 Self::BatchedIndexNestedLoopLeftJoin => "BatchedIndexNestedLoopLeftJoinExec",
61 Self::MergeJoin => "MergeJoinExec",
62 Self::HashJoin => "HashJoinExec",
63 }
64 }
65}
66
67#[derive(Debug, Clone, PartialEq, Eq)]
70pub struct RelationalOperatorCardinalityProfile {
71 pub operator_id: RelationalOperatorId,
72 pub operator: RelationalOperatorKind,
73 pub table: String,
74 pub access_path: crate::RelationalAccessPathDescriptor,
76 pub estimated_rows: usize,
77 pub actual_rows: Option<usize>,
80 pub fully_consumed: bool,
82}