#[derive(Debug, Clone, Hash, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum IndexType {
SPOC,
POSC,
OSPC,
SPO, PSO, OSP, OPS, SOP, POS,
Hash,
BTree,
Bitmap,
Bloom,
SubjectPredicate,
PredicateObject,
SubjectObject,
FullText,
SubjectIndex,
PredicateIndex,
ObjectIndex,
SubjectPredicateIndex,
PredicateObjectIndex,
SubjectObjectIndex,
FullIndex,
BTreeIndex(IndexPosition),
HashIndex(IndexPosition),
BitmapIndex(IndexPosition),
SpatialRTree,
TemporalBTree,
Spatial,
Temporal,
MultiColumnBTree(Vec<IndexPosition>),
BloomFilter(IndexPosition),
Custom(String),
}
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum IndexPosition {
Subject,
Predicate,
Object,
SubjectPredicate,
PredicateObject,
SubjectObject,
FullTriple,
}
#[derive(Debug, Clone, Default)]
pub struct IndexStatistics {
pub subject_count: usize,
pub predicate_count: usize,
pub object_count: usize,
pub triple_count: usize,
pub avg_selectivity: f64,
pub index_selectivity: f64,
pub access_frequency: usize,
pub available_indexes: std::collections::HashSet<IndexType>,
pub index_access_cost: std::collections::HashMap<IndexType, f64>,
}
#[derive(Debug, Clone)]
pub struct IndexUnionPlan {
pub left_indexes: Vec<IndexType>,
pub right_indexes: Vec<IndexType>,
pub union_cost: f64,
pub estimated_selectivity: f64,
}
#[derive(Debug, Clone)]
pub struct IndexFilterPlan {
pub pattern_index: usize,
pub filter_index: IndexType,
pub push_down_conditions: Vec<crate::algebra::Expression>,
pub estimated_cost: f64,
}