Skip to main content

EnvConfig

Struct EnvConfig 

Source
pub struct EnvConfig {
    pub compute_query_id: ComputeQueryId,
    pub explain_no_costs: bool,
    pub stats_frozen: bool,
    pub plan_deterministic: bool,
    pub disable_topk: bool,
    pub disable_joinfold: bool,
    pub random_seed: Option<u64>,
}
Expand description

Frozen snapshot of SPG_TEST_* env vars + programmatic overrides.

Every field defaults to “production behaviour”; only flips when explicitly set via env var (EnvConfig::from_env) or builder (EnvConfig::builder).

Fields§

§compute_query_id: ComputeQueryId

SPG_TEST_COMPUTE_QUERY_ID=regress — strip query-id annotations from EXPLAIN output (regression-test mode).

§explain_no_costs: bool

SPG_TEST_EXPLAIN_NO_COSTS=1 — suppress nondeterministic cost / elapsed annotations in EXPLAIN output. Used so EXPLAIN diffs are byte-equal across runs and machines.

§stats_frozen: bool

SPG_TEST_STATS_FROZEN=1 — freeze the ANALYZE-derived statistics snapshot. ANALYZE becomes a no-op; INSERT/UPDATE auto-stats refresh stops firing. Pins cost-model inputs across runs.

§plan_deterministic: bool

SPG_TEST_PLAN_DETERMINISTIC=1 — disable cost-based plan-cache and join-order decisions; fall back to a lexical / signature-hash tie break so the chosen plan is invariant w.r.t. stats jitter.

§disable_topk: bool

SPG_TEST_DISABLE_TOPK=1 — disable the aggregate top-K LIMIT fast path (select_nth_unstable_by). Forces the full-sort fallback so two plans can be diffed for the same ORDER BY + LIMIT query.

§disable_joinfold: bool

SPG_TEST_DISABLE_JOINFOLD=1 — disable the v7.37 joinfold rewrite. Lets oracle / regression harnesses compare un-folded plans against the folded baseline.

§random_seed: Option<u64>

SPG_TEST_RANDOM_SEED=N — seed every nondeterministic source (hash maps that need a seed, randomised tie-breakers, …) to a deterministic value. None means “production: derive from clock”.

Implementations§

Source§

impl EnvConfig

Source

pub fn from_env() -> Self

Read every SPG_TEST_* env var exactly once. Called by hosts (spg-server, spg-embedded, tests) at engine init; the engine itself is #![no_std] and never touches env directly on its hot path.

Only available when the std feature (default) is enabled.

Source

pub fn builder() -> EnvConfigBuilder

Builder-style override for programmatic GUC injection (used by permutation runner / oracle runner / unit tests that build an engine without env vars).

Trait Implementations§

Source§

impl Clone for EnvConfig

Source§

fn clone(&self) -> EnvConfig

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 EnvConfig

Source§

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

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

impl Default for EnvConfig

Source§

fn default() -> Self

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

impl Eq for EnvConfig

Source§

impl PartialEq for EnvConfig

Source§

fn eq(&self, other: &EnvConfig) -> 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 EnvConfig

Auto Trait Implementations§

Blanket Implementations§

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<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> 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.