Skip to main content

Module volatility

Module volatility 

Source
Expand description

SQL function volatility and expression rewrite safety over catalog metadata.

Volatility is a semantic property, not merely an optimizer hint. A VOLATILE call may not be duplicated, elided, moved to a different join level, or hidden behind a statement-local view cache. Keep the decision in one place so the view, CTE, predicate-pushdown, column-pruning, and DPccp paths cannot drift apart.

Traits§

VolatilityCatalog
Metadata needed to classify SQL expressions without invoking a routine or reading a row.

Functions§

builtin_function_volatility
Classify an already selected built-in without consulting host or SQL routine registrations. Callers that have not resolved the routine must use the catalog-aware entry point instead.
builtin_function_volatility_with_control
expr_contains_volatile_function
expr_contains_volatile_function_with_control
expression_plan_contains_volatile_function
Inspect a scalar plan with its query arena instead of treating every subquery as an opaque volatile call.
function_binding_is_volatile
function_volatility
Resolve the volatility of the implementation that can run for name.
function_volatility_with_binding
function_volatility_with_binding_and_control
query_contains_volatile_function
Inspect a complete query, including transitive view dependencies.
query_contains_volatile_function_with_control
scalar_calls_are_volatile
Inspect calls in this scalar expression only. The caller must inspect query-valued children through their owning arena before moving or duplicating an expression.
scalar_calls_are_volatile_with_control
scalar_in_scope_contains_volatile_function
Inspect an expression’s referenced subqueries under its enclosing CTE namespace. Those external producers are owned and evaluated by their defining query, not by this scalar expression.
scalar_in_scope_contains_volatile_function_with_control
scalar_with_subqueries_contains_volatile_function
Inspect a borrowed expression and only the query children it references in its owning arena. Other projections may share that arena without contributing effects to this expression.
select_contains_volatile_function
The block’s own subquery plans are inspected separately by the query-level walk, so subquery references here are not conservatively volatile.
select_contains_volatile_function_with_control
unified_plan_contains_volatile_function
Whether scalar optimizer rewrites or DPccp join enumeration must preserve volatile call scheduling. Borrow the plan and its expression roots; inspecting constants must not copy their retained payloads or allocate command child lists.
unified_plan_contains_volatile_function_with_control