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: ComputeQueryIdSPG_TEST_COMPUTE_QUERY_ID=regress — strip query-id annotations
from EXPLAIN output (regression-test mode).
explain_no_costs: boolSPG_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: boolSPG_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: boolSPG_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: boolSPG_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: boolSPG_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
impl EnvConfig
Sourcepub fn from_env() -> Self
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.
Sourcepub fn builder() -> EnvConfigBuilder
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).