pub struct OptimizationConfig {
pub target_partitions: usize,
pub enable_optimizer: bool,
pub enable_predicate_pushdown: bool,
pub enable_projection_pushdown: bool,
pub enable_parquet_pushdown: bool,
pub batch_size: usize,
pub enable_query_cache: bool,
pub max_cache_entries: usize,
pub memory_limit: Option<usize>,
}Expand description
Configuration for query optimization
Fields§
§target_partitions: usizeTarget number of partitions for parallel query execution Higher values enable more parallelism but increase overhead Default: number of CPU cores
enable_optimizer: boolEnable/disable query optimization Default: true
enable_predicate_pushdown: boolEnable/disable predicate pushdown optimization Pushes filters as early as possible in the query plan Default: true
enable_projection_pushdown: boolEnable/disable projection pushdown optimization Only reads columns that are actually needed Default: true
enable_parquet_pushdown: boolEnable/disable filter pushdown to Parquet readers Uses Parquet row group statistics to skip reading unnecessary data Default: true
batch_size: usizeBatch size for query execution Larger batches improve throughput but use more memory Default: 8192
enable_query_cache: boolEnable query result caching Default: true
max_cache_entries: usizeMaximum number of cached query results Default: 100
memory_limit: Option<usize>Memory limit for query execution (in bytes) None means unlimited Default: None
Implementations§
Source§impl OptimizationConfig
impl OptimizationConfig
Sourcepub fn with_target_partitions(self, partitions: usize) -> Self
pub fn with_target_partitions(self, partitions: usize) -> Self
Set target partitions for parallel execution
Sourcepub fn with_batch_size(self, size: usize) -> Self
pub fn with_batch_size(self, size: usize) -> Self
Set batch size for query execution
Sourcepub fn with_predicate_pushdown(self, enabled: bool) -> Self
pub fn with_predicate_pushdown(self, enabled: bool) -> Self
Enable or disable predicate pushdown
Sourcepub fn with_projection_pushdown(self, enabled: bool) -> Self
pub fn with_projection_pushdown(self, enabled: bool) -> Self
Enable or disable projection pushdown
Sourcepub fn with_parquet_pushdown(self, enabled: bool) -> Self
pub fn with_parquet_pushdown(self, enabled: bool) -> Self
Enable or disable Parquet pushdown optimizations
Sourcepub fn with_memory_limit(self, limit: usize) -> Self
pub fn with_memory_limit(self, limit: usize) -> Self
Set memory limit for query execution
Sourcepub fn with_query_cache(self, enabled: bool) -> Self
pub fn with_query_cache(self, enabled: bool) -> Self
Enable or disable query result caching
Sourcepub fn with_max_cache_entries(self, max: usize) -> Self
pub fn with_max_cache_entries(self, max: usize) -> Self
Set maximum number of cached query results
Sourcepub fn to_session_config(&self) -> SessionConfig
pub fn to_session_config(&self) -> SessionConfig
Create a DataFusion SessionConfig from this optimization config
Sourcepub fn to_runtime_env(&self) -> Arc<RuntimeEnv>
pub fn to_runtime_env(&self) -> Arc<RuntimeEnv>
Create a DataFusion RuntimeEnv from this optimization config
Trait Implementations§
Source§impl Clone for OptimizationConfig
impl Clone for OptimizationConfig
Source§fn clone(&self) -> OptimizationConfig
fn clone(&self) -> OptimizationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OptimizationConfig
impl Debug for OptimizationConfig
Source§impl Default for OptimizationConfig
impl Default for OptimizationConfig
Source§impl PartialEq for OptimizationConfig
impl PartialEq for OptimizationConfig
impl Eq for OptimizationConfig
impl StructuralPartialEq for OptimizationConfig
Auto Trait Implementations§
impl Freeze for OptimizationConfig
impl RefUnwindSafe for OptimizationConfig
impl Send for OptimizationConfig
impl Sync for OptimizationConfig
impl Unpin for OptimizationConfig
impl UnwindSafe for OptimizationConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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