Skip to main content

OptimizationConfig

Struct OptimizationConfig 

Source
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: usize

Target number of partitions for parallel query execution Higher values enable more parallelism but increase overhead Default: number of CPU cores

§enable_optimizer: bool

Enable/disable query optimization Default: true

§enable_predicate_pushdown: bool

Enable/disable predicate pushdown optimization Pushes filters as early as possible in the query plan Default: true

§enable_projection_pushdown: bool

Enable/disable projection pushdown optimization Only reads columns that are actually needed Default: true

§enable_parquet_pushdown: bool

Enable/disable filter pushdown to Parquet readers Uses Parquet row group statistics to skip reading unnecessary data Default: true

§batch_size: usize

Batch size for query execution Larger batches improve throughput but use more memory Default: 8192

§enable_query_cache: bool

Enable query result caching Default: true

§max_cache_entries: usize

Maximum 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

Source

pub fn new() -> Self

Create a new optimization configuration with default settings

Source

pub fn with_target_partitions(self, partitions: usize) -> Self

Set target partitions for parallel execution

Source

pub fn with_batch_size(self, size: usize) -> Self

Set batch size for query execution

Source

pub fn with_predicate_pushdown(self, enabled: bool) -> Self

Enable or disable predicate pushdown

Source

pub fn with_projection_pushdown(self, enabled: bool) -> Self

Enable or disable projection pushdown

Source

pub fn with_parquet_pushdown(self, enabled: bool) -> Self

Enable or disable Parquet pushdown optimizations

Source

pub fn with_memory_limit(self, limit: usize) -> Self

Set memory limit for query execution

Source

pub fn with_query_cache(self, enabled: bool) -> Self

Enable or disable query result caching

Source

pub fn with_max_cache_entries(self, max: usize) -> Self

Set maximum number of cached query results

Source

pub fn to_session_config(&self) -> SessionConfig

Create a DataFusion SessionConfig from this optimization config

Source

pub fn to_runtime_env(&self) -> Arc<RuntimeEnv>

Create a DataFusion RuntimeEnv from this optimization config

Trait Implementations§

Source§

impl Clone for OptimizationConfig

Source§

fn clone(&self) -> OptimizationConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OptimizationConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OptimizationConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for OptimizationConfig

Source§

impl PartialEq for OptimizationConfig

Source§

fn eq(&self, other: &OptimizationConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for OptimizationConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynEq for T
where T: Eq + Any,

Source§

fn dyn_eq(&self, other: &(dyn Any + 'static)) -> bool

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V