pub struct SimpleFastPathPlan {
pub table_name: String,
/* private fields */
}Expand description
Cached plan for simple fast-path eligible queries
This caches the result of is_simple_point_query() to avoid
recomputing it on every execution. Provides moderate speedup for
queries that pass fast-path validation but don’t match the
specialized PkPointLookup pattern.
§Performance Optimization (#3780)
The resolved_columns field caches column names derived from the SELECT list
after the first execution. This eliminates repeated:
- Table lookups via
database.get_table() - SELECT list iteration and column name derivation
- Schema column iteration for wildcards
This reduces per-query overhead from ~5-15µs to ~1-2µs for repeated executions.
Fields§
§table_name: StringTable name (normalized to uppercase for case-insensitive matching)
Implementations§
Source§impl SimpleFastPathPlan
impl SimpleFastPathPlan
Sourcepub fn new(table_name: String) -> Self
pub fn new(table_name: String) -> Self
Create a new SimpleFastPathPlan with the given table name
Sourcepub fn get_or_resolve_columns<F>(&self, resolver: F) -> Option<&Arc<[String]>>
pub fn get_or_resolve_columns<F>(&self, resolver: F) -> Option<&Arc<[String]>>
Get or initialize the cached column names
The resolver function is called only on the first invocation and derives column names from the SELECT list and table schema.
Sourcepub fn is_resolved(&self) -> bool
pub fn is_resolved(&self) -> bool
Check if columns have been resolved
Trait Implementations§
Source§impl Clone for SimpleFastPathPlan
impl Clone for SimpleFastPathPlan
Source§fn clone(&self) -> SimpleFastPathPlan
fn clone(&self) -> SimpleFastPathPlan
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SimpleFastPathPlan
impl RefUnwindSafe for SimpleFastPathPlan
impl Send for SimpleFastPathPlan
impl Sync for SimpleFastPathPlan
impl Unpin for SimpleFastPathPlan
impl UnwindSafe for SimpleFastPathPlan
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> 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