#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct RelationalOperatorId(usize);
impl RelationalOperatorId {
pub const fn from_plan_index(index: usize) -> Self {
Self(index.saturating_add(1))
}
pub const fn get(self) -> usize {
self.0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RelationalOperatorKind {
TableFullScan,
TablePointGet,
IndexRangeScan,
NestedLoopJoin,
NestedLoopLeftJoin,
IndexNestedLoopJoin,
IndexNestedLoopLeftJoin,
BatchedIndexNestedLoopJoin,
BatchedIndexNestedLoopLeftJoin,
MergeJoin,
HashJoin,
}
impl RelationalOperatorKind {
pub const fn as_str(self) -> &'static str {
match self {
Self::TableFullScan => "TableFullScanExec",
Self::TablePointGet => "TablePointGetExec",
Self::IndexRangeScan => "IndexRangeScanExec",
Self::NestedLoopJoin => "NestedLoopJoinExec",
Self::NestedLoopLeftJoin => "NestedLoopLeftJoinExec",
Self::IndexNestedLoopJoin => "IndexNestedLoopJoinExec",
Self::IndexNestedLoopLeftJoin => "IndexNestedLoopLeftJoinExec",
Self::BatchedIndexNestedLoopJoin => "BatchedIndexNestedLoopJoinExec",
Self::BatchedIndexNestedLoopLeftJoin => "BatchedIndexNestedLoopLeftJoinExec",
Self::MergeJoin => "MergeJoinExec",
Self::HashJoin => "HashJoinExec",
}
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RelationalOperatorCardinalityProfile {
pub operator_id: RelationalOperatorId,
pub operator: RelationalOperatorKind,
pub table: String,
pub access_path: crate::RelationalAccessPathDescriptor,
pub estimated_rows: usize,
pub actual_rows: Option<usize>,
pub fully_consumed: bool,
}