pub struct QueryHints {
pub preferred_index: Option<IndexType>,
pub limit: Option<usize>,
pub offset: Option<usize>,
pub use_bloom_filter: Option<bool>,
pub enable_caching: Option<bool>,
pub estimated_result_size: Option<usize>,
pub timeout_ms: Option<u64>,
pub collect_stats: bool,
}Expand description
Query hints for optimization
Fields§
§preferred_index: Option<IndexType>Suggested index to use (SPO, POS, or OSP)
limit: Option<usize>Maximum number of results to return
offset: Option<usize>Number of results to skip (for pagination)
use_bloom_filter: Option<bool>Whether to use bloom filter for existence checks
enable_caching: Option<bool>Whether to enable result caching
estimated_result_size: Option<usize>Estimated result size (helps with memory allocation)
timeout_ms: Option<u64>Query timeout in milliseconds
collect_stats: boolWhether to collect detailed execution statistics
Implementations§
Source§impl QueryHints
impl QueryHints
Sourcepub fn with_index(self, index: IndexType) -> Self
pub fn with_index(self, index: IndexType) -> Self
Set preferred index
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Set result limit
Sourcepub fn with_offset(self, offset: usize) -> Self
pub fn with_offset(self, offset: usize) -> Self
Set result offset
Sourcepub fn with_bloom_filter(self, enable: bool) -> Self
pub fn with_bloom_filter(self, enable: bool) -> Self
Enable/disable bloom filter
Sourcepub fn with_caching(self, enable: bool) -> Self
pub fn with_caching(self, enable: bool) -> Self
Enable/disable caching
Sourcepub fn with_estimated_size(self, size: usize) -> Self
pub fn with_estimated_size(self, size: usize) -> Self
Set estimated result size
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set query timeout
Sourcepub fn with_stats(self, collect: bool) -> Self
pub fn with_stats(self, collect: bool) -> Self
Enable statistics collection
Sourcepub fn auto_select_index(
s_bound: bool,
p_bound: bool,
o_bound: bool,
) -> IndexType
pub fn auto_select_index( s_bound: bool, p_bound: bool, o_bound: bool, ) -> IndexType
Automatically select the best index based on query pattern
Returns the optimal index type based on which components are bound:
- If S is bound: use SPO
- If P is bound but S is not: use POS
- If O is bound but S and P are not: use OSP
Sourcepub fn merge(&self, other: &QueryHints) -> QueryHints
pub fn merge(&self, other: &QueryHints) -> QueryHints
Merge with another set of hints (other takes precedence)
Sourcepub fn apply_pagination<T>(&self, results: Vec<T>) -> Vec<T>
pub fn apply_pagination<T>(&self, results: Vec<T>) -> Vec<T>
Apply pagination to results
Trait Implementations§
Source§impl Clone for QueryHints
impl Clone for QueryHints
Source§impl Debug for QueryHints
impl Debug for QueryHints
Auto Trait Implementations§
impl Freeze for QueryHints
impl RefUnwindSafe for QueryHints
impl Send for QueryHints
impl Sync for QueryHints
impl Unpin for QueryHints
impl UnsafeUnpin for QueryHints
impl UnwindSafe for QueryHints
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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> ⓘ
Converts
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> ⓘ
Converts
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