pub struct Config {
pub path: Option<PathBuf>,
pub memory_limit: Option<usize>,
pub spill_path: Option<PathBuf>,
pub threads: usize,
pub wal_enabled: bool,
pub wal_flush_interval_ms: u64,
pub backward_edges: bool,
pub query_logging: bool,
pub adaptive: AdaptiveConfig,
pub factorized_execution: bool,
}Expand description
Database configuration.
Fields§
§path: Option<PathBuf>Path to the database directory (None for in-memory only).
memory_limit: Option<usize>Memory limit in bytes (None for unlimited).
spill_path: Option<PathBuf>Path for spilling data to disk under memory pressure.
threads: usizeNumber of worker threads for query execution.
wal_enabled: boolWhether to enable WAL for durability.
wal_flush_interval_ms: u64WAL flush interval in milliseconds.
backward_edges: boolWhether to maintain backward edges.
query_logging: boolWhether to enable query logging.
adaptive: AdaptiveConfigAdaptive execution configuration.
factorized_execution: boolWhether to use factorized execution for multi-hop queries.
When enabled, consecutive MATCH expansions are executed using factorized representation which avoids Cartesian product materialization. This provides 5-100x speedup for multi-hop queries with high fan-out.
Enabled by default.
Implementations§
Source§impl Config
impl Config
Sourcepub fn persistent(path: impl Into<PathBuf>) -> Self
pub fn persistent(path: impl Into<PathBuf>) -> Self
Creates a new configuration for a persistent database.
Sourcepub fn with_memory_limit(self, limit: usize) -> Self
pub fn with_memory_limit(self, limit: usize) -> Self
Sets the memory limit.
Sourcepub fn with_threads(self, threads: usize) -> Self
pub fn with_threads(self, threads: usize) -> Self
Sets the number of worker threads.
Sourcepub fn without_backward_edges(self) -> Self
pub fn without_backward_edges(self) -> Self
Disables backward edges.
Sourcepub fn with_query_logging(self) -> Self
pub fn with_query_logging(self) -> Self
Enables query logging.
Sourcepub fn with_memory_fraction(self, fraction: f64) -> Self
pub fn with_memory_fraction(self, fraction: f64) -> Self
Sets the memory budget as a fraction of system RAM.
Sourcepub fn with_spill_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_spill_path(self, path: impl Into<PathBuf>) -> Self
Sets the spill directory for out-of-core processing.
Sourcepub fn with_adaptive(self, adaptive: AdaptiveConfig) -> Self
pub fn with_adaptive(self, adaptive: AdaptiveConfig) -> Self
Sets the adaptive execution configuration.
Sourcepub fn without_adaptive(self) -> Self
pub fn without_adaptive(self) -> Self
Disables adaptive execution.
Sourcepub fn without_factorized_execution(self) -> Self
pub fn without_factorized_execution(self) -> Self
Disables factorized execution for multi-hop queries.
This reverts to the traditional flat execution model where each expansion creates a full Cartesian product. Only use this if you encounter issues with factorized execution.