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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more